public function XmlFileLoaderTest::testLoadInlinedServices in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/dependency-injection/Tests/Loader/XmlFileLoaderTest.php \Symfony\Component\DependencyInjection\Tests\Loader\XmlFileLoaderTest::testLoadInlinedServices()
File
- vendor/
symfony/ dependency-injection/ Tests/ Loader/ XmlFileLoaderTest.php, line 467
Class
Namespace
Symfony\Component\DependencyInjection\Tests\LoaderCode
public function testLoadInlinedServices() {
$container = new ContainerBuilder();
$loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath . '/xml'));
$loader
->load('services21.xml');
$foo = $container
->getDefinition('foo');
$fooFactory = $foo
->getFactory();
$this
->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Definition', $fooFactory[0]);
$this
->assertSame('FooFactory', $fooFactory[0]
->getClass());
$this
->assertSame('createFoo', $fooFactory[1]);
$fooFactoryFactory = $fooFactory[0]
->getFactory();
$this
->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Definition', $fooFactoryFactory[0]);
$this
->assertSame('Foobar', $fooFactoryFactory[0]
->getClass());
$this
->assertSame('createFooFactory', $fooFactoryFactory[1]);
$fooConfigurator = $foo
->getConfigurator();
$this
->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Definition', $fooConfigurator[0]);
$this
->assertSame('Bar', $fooConfigurator[0]
->getClass());
$this
->assertSame('configureFoo', $fooConfigurator[1]);
$barConfigurator = $fooConfigurator[0]
->getConfigurator();
$this
->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Definition', $barConfigurator[0]);
$this
->assertSame('Baz', $barConfigurator[0]
->getClass());
$this
->assertSame('configureBar', $barConfigurator[1]);
}