public function ContainerTest::testAddScope 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::testAddScope()
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Tests/ ContainerTest.php, line 517
Class
Namespace
Symfony\Component\DependencyInjection\TestsCode
public function testAddScope() {
$c = new Container();
$c
->addScope(new Scope('foo'));
$c
->addScope(new Scope('bar', 'foo'));
$this
->assertSame(array(
'foo' => 'container',
'bar' => 'foo',
), $this
->getField($c, 'scopes'));
$this
->assertSame(array(
'foo' => array(
'bar',
),
'bar' => array(),
), $this
->getField($c, 'scopeChildren'));
$c
->addScope(new Scope('baz', 'bar'));
$this
->assertSame(array(
'foo' => 'container',
'bar' => 'foo',
'baz' => 'bar',
), $this
->getField($c, 'scopes'));
$this
->assertSame(array(
'foo' => array(
'bar',
'baz',
),
'bar' => array(
'baz',
),
'baz' => array(),
), $this
->getField($c, 'scopeChildren'));
}