You are here

public function PhpDumperTest::testCircularReference in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/dependency-injection/Tests/Dumper/PhpDumperTest.php \Symfony\Component\DependencyInjection\Tests\Dumper\PhpDumperTest::testCircularReference()

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

File

vendor/symfony/dependency-injection/Tests/Dumper/PhpDumperTest.php, line 210

Class

PhpDumperTest

Namespace

Symfony\Component\DependencyInjection\Tests\Dumper

Code

public function testCircularReference() {
  $container = new ContainerBuilder();
  $container
    ->register('foo', 'stdClass')
    ->addArgument(new Reference('bar'));
  $container
    ->register('bar', 'stdClass')
    ->setPublic(false)
    ->addMethodCall('setA', array(
    new Reference('baz'),
  ));
  $container
    ->register('baz', 'stdClass')
    ->addMethodCall('setA', array(
    new Reference('foo'),
  ));
  $container
    ->compile();
  $dumper = new PhpDumper($container);
  $dumper
    ->dump();
}