public function ContainerTest::testAddScope

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerTest.php, line 316

Class

ContainerTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

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'));
}