public function ContainerBuilderTest::testCreateServiceFactoryService

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

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php, line 322

Class

ContainerBuilderTest

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'));
}