You are here

public function LegacyContainerBuilderTest::testCreateServiceFactoryService in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/Tests/LegacyContainerBuilderTest.php \Symfony\Component\DependencyInjection\Tests\LegacyContainerBuilderTest::testCreateServiceFactoryService()

@covers Symfony\Component\DependencyInjection\ContainerBuilder::createService

File

vendor/symfony/dependency-injection/Tests/LegacyContainerBuilderTest.php, line 38

Class

LegacyContainerBuilderTest
@group legacy

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testCreateServiceFactoryService() {
  $builder = new ContainerBuilder();
  $builder
    ->register('baz_service')
    ->setFactoryService('baz_factory')
    ->setFactoryMethod('getInstance');
  $builder
    ->register('baz_factory', 'BazClass');
  $this
    ->assertInstanceOf('BazClass', $builder
    ->get('baz_service'));
}