@@ -152,10 +152,12 @@ public function testTwigLoaderPaths($format)
152
152
$ this ->compileContainer ($ container );
153
153
154
154
$ def = $ container ->getDefinition ('twig.loader.filesystem ' );
155
- $ paths = array ();
155
+ $ paths = array (); $ prependPaths = array ();
156
156
foreach ($ def ->getMethodCalls () as $ call ) {
157
157
if ('addPath ' === $ call [0 ] && false === strpos ($ call [1 ][0 ], 'Form ' )) {
158
158
$ paths [] = $ call [1 ];
159
+ } elseif ('prependPath ' === $ call [0 ]) {
160
+ $ prependPaths [] = $ call [1 ];
159
161
}
160
162
}
161
163
@@ -167,8 +169,13 @@ public function testTwigLoaderPaths($format)
167
169
array ('namespaced_path3 ' , 'namespace3 ' ),
168
170
array (__DIR__ .'/Fixtures/Resources/TwigBundle/views ' , 'Twig ' ),
169
171
array (realpath (__DIR__ .'/../.. ' ).'/Resources/views ' , 'Twig ' ),
172
+ array (__DIR__ .'/Fixtures/Bundle/TwigResourcesBundle/Resources/views ' , 'TwigResources ' ),
170
173
array (__DIR__ .'/Fixtures/Resources/views ' ),
171
174
), $ paths );
175
+
176
+ $ this ->assertEquals (array (
177
+ array (__DIR__ .'/Fixtures/Bundle/TwigResourcesBundle/Resources/views ' , 'Twig ' ),
178
+ ), $ prependPaths );
172
179
}
173
180
174
181
public function getFormats ()
@@ -218,7 +225,10 @@ private function createContainer()
218
225
'kernel.root_dir ' => __DIR__ .'/Fixtures ' ,
219
226
'kernel.charset ' => 'UTF-8 ' ,
220
227
'kernel.debug ' => false ,
221
- 'kernel.bundles ' => array ('TwigBundle ' => 'Symfony \\Bundle \\TwigBundle \\TwigBundle ' ),
228
+ 'kernel.bundles ' => array (
229
+ 'TwigBundle ' => 'Symfony \\Bundle \\TwigBundle \\TwigBundle ' ,
230
+ 'TwigResourcesBundle ' => 'Symfony \\Bundle \\TwigBundle \\Tests \\DependencyInjection \\Fixtures \\Bundle \\TwigResourcesBundle \\TwigResourcesBundle ' ,
231
+ ),
222
232
)));
223
233
224
234
return $ container ;
0 commit comments