public function ContainerTest::testSetAlsoSetsScopedService

File

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

Class

ContainerTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testSetAlsoSetsScopedService() {
  $c = new Container();
  $c
    ->addScope(new Scope('foo'));
  $c
    ->enterScope('foo');
  $c
    ->set('foo', $foo = new \stdClass(), 'foo');
  $services = $this
    ->getField($c, 'scopedServices');
  $this
    ->assertTrue(isset($services['foo']['foo']));
  $this
    ->assertSame($foo, $services['foo']['foo']);
}