public function PhpDumperTest::testCircularReference in Service Container 7.2
Same name and namespace in other branches
- 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php \Symfony\Component\DependencyInjection\Tests\Dumper\PhpDumperTest::testCircularReference()
@expectedException \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Tests/ Dumper/ PhpDumperTest.php, line 212
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();
}