function ContainerBuilderTest::testGet
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php \Drupal\Tests\Core\DependencyInjection\ContainerBuilderTest::testGet()
- 8.9.x core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php \Drupal\Tests\Core\DependencyInjection\ContainerBuilderTest::testGet()
- 10 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 21
Class
- ContainerBuilderTest
- @coversDefaultClass \Drupal\Core\DependencyInjection\ContainerBuilder @group DependencyInjection
Namespace
Drupal\Tests\Core\DependencyInjectionCode
public function testGet() : void {
$container = new ContainerBuilder();
$container->register('bar', 'Drupal\\Tests\\Core\\DependencyInjection\\Fixture\\BarClass');
$result = $container->get('bar');
$this->assertInstanceOf(BarClass::class, $result);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.