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