* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Loader; use PHPUnit\Framework\TestCase; use Symfony\Component\Config\FileLocator; use Symfony\Component\Config\Loader\LoaderResolver; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\ClosureLoader; use Symfony\Component\DependencyInjection\Loader\IniFileLoader; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; class LoaderResolverTest extends TestCase { private static $fixturesPath; /** @var LoaderResolver */ private $resolver; protected function setUp() { self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); $container = new ContainerBuilder(); $this->resolver = new LoaderResolver(array( new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')), new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')), new IniFileLoader($container, new FileLocator(self::$fixturesPath.'/ini')), new PhpFileLoader($container, new FileLocator(self::$fixturesPath.'/php')), new ClosureLoader($container), )); } public function provideResourcesToLoad() { return array( array('ini_with_wrong_ext.xml', 'ini', IniFileLoader::class), array('xml_with_wrong_ext.php', 'xml', XmlFileLoader::class), array('php_with_wrong_ext.yml', 'php', PhpFileLoader::class), array('yaml_with_wrong_ext.ini', 'yaml', YamlFileLoader::class), ); } /** * @dataProvider provideResourcesToLoad */ public function testResolvesForcedType($resource, $type, $expectedClass) { $this->assertInstanceOf($expectedClass, $this->resolver->resolve($resource, $type)); } } __halt_compiler();----SIGNATURE:----B/fqAemqdRliTL8nlFQtcavFXhpRX3QWMixwdRnh5vIHjjncGqfPyJsjB4v8DEbVsuAHvde5Quw9PNhlY4s4osrI2qcns5069iLOf5jo5mLji4MQhfeoWXEbYOIL+aZz2OreAeH00oi+m7uaIa9A26AxjJmBnu7QcOuuB1nQcXgBAO34jiOO1Krlgwv6vpAO+3Kk6CJJ0tGGmjEOAUXdnFMQqEd+DDg0ylxV3T7xFvQ2VhP/RTsP5hYcY0U4KyKZpeEyU8NpHpBw8i7eF2FAhBouJpFDhqmt2+qwqfYIYRa0MYI6+bCM8XgO6tlW8FxV1vH4JlUzRmq3QPPxWGY5wTIt4cZbDm4dQPuSMe8LCBfhV+6rerv3iJbE8cTHrHeiBmPE9nv2VvpB6mEUU5liaxcL8JjB1LNehOPD+BOWyv2ow92yBoYqmmaTTNoOUCz+swyiYCfm9WrPINDBZMisBYkOmscKp7leGL59RlW5fp9y1d+qrFLssdXAcOplOS7jCb7ns7WvIohSSSZA2FtbTzhLbSb0RiZ2NbFywHmWRzu7pJDq2y2EVMw0zZVmLKjcC1sl6Uddq6QL/Ehv2Ck4SNjoTuiuZfCczxU8fGtHgRqOrIHgPZXAsSzOvYL2GrsTk867VjdYA0IWcybyAedLPHE6dNLB2zI63i5kjiBFP5U=----ATTACHMENT:----NTc0MDM3OTY1NDU3OTcwOCA2MTMxNzQ0MzgzODUxMzcyIDUxNDQ1MTQxMTkyNjAxMTM=