public function ContainerBuilderTest::testLegacyCreateServiceFactoryService in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/dependency-injection/Tests/ContainerBuilderTest.php \Symfony\Component\DependencyInjection\Tests\ContainerBuilderTest::testLegacyCreateServiceFactoryService()
@covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
File
- vendor/
symfony/ dependency-injection/ Tests/ ContainerBuilderTest.php, line 362
Class
Namespace
Symfony\Component\DependencyInjection\TestsCode
public function testLegacyCreateServiceFactoryService() {
$builder = new ContainerBuilder();
$builder
->register('foo_service', 'Bar\\FooClass');
$builder
->register('foo', 'Bar\\FooClass')
->setFactoryService('%foo_service%')
->setFactoryMethod('getInstance');
$builder
->setParameter('foo_service', 'foo_service');
$this
->assertTrue($builder
->get('foo')->called, '->createService() calls the factory method to create the service instance');
}