diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php index 8a0a14ddb3..16e5787bdf 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php @@ -21,7 +21,9 @@ abstract class CompleteConfigurationTest extends \PHPUnit_Framework_TestCase { private static $containerCache = array(); - abstract protected function loadFromFile(ContainerBuilder $container, $file); + abstract protected function getLoader(ContainerBuilder $container); + + abstract protected function getFileExtension(); public function testRolesHierarchy() { @@ -237,6 +239,8 @@ abstract class CompleteConfigurationTest extends \PHPUnit_Framework_TestCase protected function getContainer($file) { + $file = $file.'.'.$this->getFileExtension(); + if (isset(self::$containerCache[$file])) { return self::$containerCache[$file]; } @@ -246,7 +250,7 @@ abstract class CompleteConfigurationTest extends \PHPUnit_Framework_TestCase $bundle = new SecurityBundle(); $bundle->build($container); // Attach all default factories - $this->loadFromFile($container, $file); + $this->getLoader($container)->load($file); $container->getCompilerPassConfig()->setOptimizationPasses(array()); $container->getCompilerPassConfig()->setRemovingPasses(array()); diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/PhpCompleteConfigurationTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/PhpCompleteConfigurationTest.php index 131c38d5e5..6495485d1b 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/PhpCompleteConfigurationTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/PhpCompleteConfigurationTest.php @@ -17,9 +17,13 @@ use Symfony\Component\Config\FileLocator; class PhpCompleteConfigurationTest extends CompleteConfigurationTest { - protected function loadFromFile(ContainerBuilder $container, $file) + protected function getLoader(ContainerBuilder $container) { - $loadXml = new PhpFileLoader($container, new FileLocator(__DIR__.'/Fixtures/php')); - $loadXml->load($file.'.php'); + return new PhpFileLoader($container, new FileLocator(__DIR__.'/Fixtures/php')); + } + + protected function getFileExtension() + { + return 'php'; } } diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/XmlCompleteConfigurationTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/XmlCompleteConfigurationTest.php index cf6833a22a..2399f5ee46 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/XmlCompleteConfigurationTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/XmlCompleteConfigurationTest.php @@ -17,9 +17,13 @@ use Symfony\Component\Config\FileLocator; class XmlCompleteConfigurationTest extends CompleteConfigurationTest { - protected function loadFromFile(ContainerBuilder $container, $file) + protected function getLoader(ContainerBuilder $container) { - $loadXml = new XmlFileLoader($container, new FileLocator(__DIR__.'/Fixtures/xml')); - $loadXml->load($file.'.xml'); + return new XmlFileLoader($container, new FileLocator(__DIR__.'/Fixtures/xml')); + } + + protected function getFileExtension() + { + return 'xml'; } } diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/YamlCompleteConfigurationTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/YamlCompleteConfigurationTest.php index 568b8623ea..d5d5e693ab 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/YamlCompleteConfigurationTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/YamlCompleteConfigurationTest.php @@ -17,9 +17,13 @@ use Symfony\Component\Config\FileLocator; class YamlCompleteConfigurationTest extends CompleteConfigurationTest { - protected function loadFromFile(ContainerBuilder $container, $file) + protected function getLoader(ContainerBuilder $container) { - $loadXml = new YamlFileLoader($container, new FileLocator(__DIR__.'/Fixtures/yml')); - $loadXml->load($file.'.yml'); + return new YamlFileLoader($container, new FileLocator(__DIR__.'/Fixtures/yml')); + } + + protected function getFileExtension() + { + return 'yml'; } }