public function PhpDumperTest::testCircularReference in Zircon Profile 8
Same name and namespace in other branches
- 8.0 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
Namespace
Symfony\Component\DependencyInjection\Tests\DumperCode
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();
}