File tree Expand file tree Collapse file tree 4 files changed +27
-11
lines changed
src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection Expand file tree Collapse file tree 4 files changed +27
-11
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ abstract class CompleteConfigurationTest extends \PHPUnit_Framework_TestCase
21
21
{
22
22
private static $ containerCache = array ();
23
23
24
- abstract protected function loadFromFile (ContainerBuilder $ container , $ file );
24
+ abstract protected function getLoader (ContainerBuilder $ container );
25
+
26
+ abstract protected function getFileExtension ();
25
27
26
28
public function testRolesHierarchy ()
27
29
{
@@ -237,6 +239,8 @@ public function testRememberMeThrowExceptions()
237
239
238
240
protected function getContainer ($ file )
239
241
{
242
+ $ file = $ file .'. ' .$ this ->getFileExtension ();
243
+
240
244
if (isset (self ::$ containerCache [$ file ])) {
241
245
return self ::$ containerCache [$ file ];
242
246
}
@@ -246,7 +250,7 @@ protected function getContainer($file)
246
250
247
251
$ bundle = new SecurityBundle ();
248
252
$ bundle ->build ($ container ); // Attach all default factories
249
- $ this ->loadFromFile ($ container, $ file );
253
+ $ this ->getLoader ($ container)-> load ( $ file );
250
254
251
255
$ container ->getCompilerPassConfig ()->setOptimizationPasses (array ());
252
256
$ container ->getCompilerPassConfig ()->setRemovingPasses (array ());
Original file line number Diff line number Diff line change 17
17
18
18
class PhpCompleteConfigurationTest extends CompleteConfigurationTest
19
19
{
20
- protected function loadFromFile (ContainerBuilder $ container, $ file )
20
+ protected function getLoader (ContainerBuilder $ container )
21
21
{
22
- $ loadXml = new PhpFileLoader ($ container , new FileLocator (__DIR__ .'/Fixtures/php ' ));
23
- $ loadXml ->load ($ file .'.php ' );
22
+ return new PhpFileLoader ($ container , new FileLocator (__DIR__ .'/Fixtures/php ' ));
23
+ }
24
+
25
+ protected function getFileExtension ()
26
+ {
27
+ return 'php ' ;
24
28
}
25
29
}
Original file line number Diff line number Diff line change 17
17
18
18
class XmlCompleteConfigurationTest extends CompleteConfigurationTest
19
19
{
20
- protected function loadFromFile (ContainerBuilder $ container, $ file )
20
+ protected function getLoader (ContainerBuilder $ container )
21
21
{
22
- $ loadXml = new XmlFileLoader ($ container , new FileLocator (__DIR__ .'/Fixtures/xml ' ));
23
- $ loadXml ->load ($ file .'.xml ' );
22
+ return new XmlFileLoader ($ container , new FileLocator (__DIR__ .'/Fixtures/xml ' ));
23
+ }
24
+
25
+ protected function getFileExtension ()
26
+ {
27
+ return 'xml ' ;
24
28
}
25
29
}
Original file line number Diff line number Diff line change 17
17
18
18
class YamlCompleteConfigurationTest extends CompleteConfigurationTest
19
19
{
20
- protected function loadFromFile (ContainerBuilder $ container, $ file )
20
+ protected function getLoader (ContainerBuilder $ container )
21
21
{
22
- $ loadXml = new YamlFileLoader ($ container , new FileLocator (__DIR__ .'/Fixtures/yml ' ));
23
- $ loadXml ->load ($ file .'.yml ' );
22
+ return new YamlFileLoader ($ container , new FileLocator (__DIR__ .'/Fixtures/yml ' ));
23
+ }
24
+
25
+ protected function getFileExtension ()
26
+ {
27
+ return 'yml ' ;
24
28
}
25
29
}
You can’t perform that action at this time.
0 commit comments