File tree Expand file tree Collapse file tree 2 files changed +49
-1
lines changed
Tests/DependencyInjection Expand file tree Collapse file tree 2 files changed +49
-1
lines changed Original file line number Diff line number Diff line change @@ -339,7 +339,7 @@ private function addFormatListenerSection(ArrayNodeDefinition $rootNode)
339339 ->children ()
340340 ->scalarNode ('service ' )->defaultNull ()->end ()
341341 ->arrayNode ('rules ' )
342- ->cannotBeOverwritten ()
342+ ->performNoDeepMerging ()
343343 ->prototype ('array ' )
344344 ->fixXmlConfig ('priority ' , 'priorities ' )
345345 ->fixXmlConfig ('attribute ' , 'attributes ' )
Original file line number Diff line number Diff line change @@ -150,6 +150,54 @@ public function testLoadBadCodesClassThrowsException()
150150 );
151151 }
152152
153+ public function testOverwriteFormatListenerRulesDoesNotMerge ()
154+ {
155+ $ configuration = $ this ->processor ->processConfiguration (
156+ $ this ->configuration ,
157+ [
158+ [
159+ 'format_listener ' => [
160+ 'rules ' => [
161+ [
162+ 'path ' => '^/admin ' ,
163+ 'priorities ' => ['html ' ],
164+ ],
165+ [
166+ 'path ' => '^/ ' ,
167+ 'priorities ' => ['html ' , 'json ' ],
168+ ],
169+ ],
170+ ],
171+ ],
172+ [
173+ 'format_listener ' => [
174+ 'rules ' => [
175+ [
176+ 'path ' => '^/ ' ,
177+ 'priorities ' => ['json ' ],
178+ ],
179+ ],
180+ ],
181+ ],
182+ ]
183+ );
184+
185+ $ expected = [
186+ [
187+ 'path ' => '^/ ' ,
188+ 'priorities ' => ['json ' ],
189+ 'host ' => null ,
190+ 'methods ' => null ,
191+ 'attributes ' => [],
192+ 'stop ' => false ,
193+ 'prefer_extension ' => true ,
194+ 'fallback_format ' => 'html ' ,
195+ ],
196+ ];
197+
198+ $ this ->assertEquals ($ expected , $ configuration ['format_listener ' ]['rules ' ]);
199+ }
200+
153201 /**
154202 * incorrectExceptionCodeProvider.
155203 *
You can’t perform that action at this time.
0 commit comments