public function ContainerTest::testSetAlsoSetsScopedService in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/dependency-injection/Tests/ContainerTest.php \Symfony\Component\DependencyInjection\Tests\ContainerTest::testSetAlsoSetsScopedService()
File
- vendor/
symfony/ dependency-injection/ Tests/ ContainerTest.php, line 191
Class
Namespace
Symfony\Component\DependencyInjection\TestsCode
public function testSetAlsoSetsScopedService() {
$c = new Container();
$c
->addScope(new Scope('foo'));
$c
->enterScope('foo');
$c
->set('foo', $foo = new \stdClass(), 'foo');
$scoped = $this
->getField($c, 'scopedServices');
$this
->assertTrue(isset($scoped['foo']['foo']), '->set() sets a scoped service');
$this
->assertSame($foo, $scoped['foo']['foo'], '->set() sets a scoped service');
}