public function ContainerTest::testIsScopeActive

File

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

Class

ContainerTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testIsScopeActive() {
  $c = new Container();
  $this
    ->assertFalse($c
    ->isScopeActive('foo'));
  $c
    ->addScope(new Scope('foo'));
  $this
    ->assertFalse($c
    ->isScopeActive('foo'));
  $c
    ->enterScope('foo');
  $this
    ->assertTrue($c
    ->isScopeActive('foo'));
  $c
    ->leaveScope('foo');
  $this
    ->assertFalse($c
    ->isScopeActive('foo'));
}