You are here

public function ContainerBuilderTest::testGet in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/dependency-injection/Tests/ContainerBuilderTest.php \Symfony\Component\DependencyInjection\Tests\ContainerBuilderTest::testGet()
  2. 8 core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php \Drupal\Tests\Core\DependencyInjection\ContainerBuilderTest::testGet()
Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php \Drupal\Tests\Core\DependencyInjection\ContainerBuilderTest::testGet()

@covers ::get

File

core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php, line 23
Contains \Drupal\Tests\Core\DependencyInjection\ContainerBuilderTest.

Class

ContainerBuilderTest
@coversDefaultClass \Drupal\Core\DependencyInjection\ContainerBuilder @group DependencyInjection

Namespace

Drupal\Tests\Core\DependencyInjection

Code

public function testGet() {
  $container = new ContainerBuilder();
  $container
    ->register('bar', 'Drupal\\Tests\\Core\\DependencyInjection\\Fixture\\BarClass');
  $result = $container
    ->get('bar');
  $this
    ->assertTrue($result instanceof BarClass);
}