public function CheckCircularReferencesPassTest::testProcessDetectsIndirectCircularReferenceWithFactory in Service Container 7.2
Same name and namespace in other branches
- 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Compiler/CheckCircularReferencesPassTest.php \Symfony\Component\DependencyInjection\Tests\Compiler\CheckCircularReferencesPassTest::testProcessDetectsIndirectCircularReferenceWithFactory()
@expectedException \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Tests/ Compiler/ CheckCircularReferencesPassTest.php, line 81
Class
Namespace
Symfony\Component\DependencyInjection\Tests\CompilerCode
public function testProcessDetectsIndirectCircularReferenceWithFactory() {
$container = new ContainerBuilder();
$container
->register('a')
->addArgument(new Reference('b'));
$container
->register('b', 'stdClass')
->setFactory(array(
new Reference('c'),
'getInstance',
));
$container
->register('c')
->addArgument(new Reference('a'));
$this
->process($container);
}