You are here

public function ContainerBuilderTest::testGetReturnsNullOnInactiveScope in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php \Symfony\Component\DependencyInjection\Tests\ContainerBuilderTest::testGetReturnsNullOnInactiveScope()

@covers Symfony\Component\DependencyInjection\ContainerBuilder::get

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php, line 147

Class

ContainerBuilderTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testGetReturnsNullOnInactiveScope() {
  $builder = new ContainerBuilder();
  $builder
    ->register('foo', 'stdClass')
    ->setScope('request');
  $this
    ->assertNull($builder
    ->get('foo', ContainerInterface::NULL_ON_INVALID_REFERENCE));
}