You are here

public function YamlFileLoaderTest::testLoadFactoryShortSyntax in Zircon Profile 8.0

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

File

vendor/symfony/dependency-injection/Tests/Loader/YamlFileLoaderTest.php, line 178

Class

YamlFileLoaderTest

Namespace

Symfony\Component\DependencyInjection\Tests\Loader

Code

public function testLoadFactoryShortSyntax() {
  $container = new ContainerBuilder();
  $loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath . '/yaml'));
  $loader
    ->load('services14.yml');
  $services = $container
    ->getDefinitions();
  $this
    ->assertEquals(array(
    new Reference('baz'),
    'getClass',
  ), $services['factory']
    ->getFactory(), '->load() parses the factory tag with service:method');
  $this
    ->assertEquals(array(
    'FooBacFactory',
    'createFooBar',
  ), $services['factory_with_static_call']
    ->getFactory(), '->load() parses the factory tag with Class::method');
}