File tree 2 files changed +13
-1
lines changed
src/Symfony/Bundle/TwigBundle
Tests/DependencyInjection
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ private function addTwigOptions(ArrayNodeDefinition $rootNode)
147
147
->normalizeKeys (false )
148
148
->useAttributeAsKey ('paths ' )
149
149
->beforeNormalization ()
150
- ->always ()
150
+ ->ifArray ()
151
151
->then (function ($ paths ) {
152
152
$ normalized = [];
153
153
foreach ($ paths as $ path => $ namespace ) {
Original file line number Diff line number Diff line change @@ -52,4 +52,16 @@ public function testArrayKeysInGlobalsAreNotNormalized()
52
52
53
53
$ this ->assertSame (['global ' => ['value ' => ['some-key ' => 'some-value ' ]]], $ config ['globals ' ]);
54
54
}
55
+
56
+ public function testNullPathsAreConvertedToIterable ()
57
+ {
58
+ $ input = [
59
+ 'paths ' => null ,
60
+ ];
61
+
62
+ $ processor = new Processor ();
63
+ $ config = $ processor ->processConfiguration (new Configuration (), [$ input ]);
64
+
65
+ $ this ->assertSame ([], $ config ['paths ' ]);
66
+ }
55
67
}
You can’t perform that action at this time.
0 commit comments