public function ContainerTest::testSetAlsoSetsScopedService in Service Container 7
Same name and namespace in other branches
- 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/ContainerTest.php \Symfony\Component\DependencyInjection\Tests\ContainerTest::testSetAlsoSetsScopedService()
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ 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');
}