You are here

public function CheckCircularReferencesPassTest::testProcessDetectsIndirectCircularReferenceWithFactory in Zircon Profile 8

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

@expectedException \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException

File

vendor/symfony/dependency-injection/Tests/Compiler/CheckCircularReferencesPassTest.php, line 81

Class

CheckCircularReferencesPassTest

Namespace

Symfony\Component\DependencyInjection\Tests\Compiler

Code

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