You are here

public function XmlFileLoaderTest::testLegacyLoadServices in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/dependency-injection/Tests/Loader/XmlFileLoaderTest.php \Symfony\Component\DependencyInjection\Tests\Loader\XmlFileLoaderTest::testLegacyLoadServices()

@group legacy

File

vendor/symfony/dependency-injection/Tests/Loader/XmlFileLoaderTest.php, line 196

Class

XmlFileLoaderTest

Namespace

Symfony\Component\DependencyInjection\Tests\Loader

Code

public function testLegacyLoadServices() {
  $container = new ContainerBuilder();
  $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath . '/xml'));
  $loader
    ->load('legacy-services6.xml');
  $services = $container
    ->getDefinitions();
  $this
    ->assertEquals('FooClass', $services['constructor']
    ->getClass());
  $this
    ->assertEquals('getInstance', $services['constructor']
    ->getFactoryMethod());
  $this
    ->assertNull($services['factory_service']
    ->getClass());
  $this
    ->assertEquals('baz_factory', $services['factory_service']
    ->getFactoryService());
  $this
    ->assertEquals('getInstance', $services['factory_service']
    ->getFactoryMethod());
  $this
    ->assertTrue($services['request']
    ->isSynthetic(), '->load() parses the synthetic flag');
  $this
    ->assertTrue($services['request']
    ->isSynchronized(), '->load() parses the synchronized flag');
  $this
    ->assertTrue($services['request']
    ->isLazy(), '->load() parses the lazy flag');
  $this
    ->assertNull($services['request']
    ->getDecoratedService());
}