public function ContainerBuilderTest::testLegacySetOnSynchronizedService in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/dependency-injection/Tests/ContainerBuilderTest.php \Symfony\Component\DependencyInjection\Tests\ContainerBuilderTest::testLegacySetOnSynchronizedService()
@group legacy
File
- vendor/
symfony/ dependency-injection/ Tests/ ContainerBuilderTest.php, line 732
Class
Namespace
Symfony\Component\DependencyInjection\TestsCode
public function testLegacySetOnSynchronizedService() {
$container = new ContainerBuilder();
$container
->register('baz', 'BazClass')
->setSynchronized(true);
$container
->register('bar', 'BarClass')
->addMethodCall('setBaz', array(
new Reference('baz'),
));
$container
->set('baz', $baz = new \BazClass());
$this
->assertSame($baz, $container
->get('bar')
->getBaz());
$container
->set('baz', $baz = new \BazClass());
$this
->assertSame($baz, $container
->get('bar')
->getBaz());
}