public function ContainerTest::testGetForClassFromParameter in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php \Drupal\Tests\Component\DependencyInjection\ContainerTest::testGetForClassFromParameter()
- 10 core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php \Drupal\Tests\Component\DependencyInjection\ContainerTest::testGetForClassFromParameter()
Tests that Container::get() works properly for class from parameters.
@covers ::get @covers ::createService
File
- core/
tests/ Drupal/ Tests/ Component/ DependencyInjection/ ContainerTest.php, line 190 - Contains \Drupal\Tests\Component\DependencyInjection\ContainerTest.
Class
- ContainerTest
- @coversDefaultClass \Drupal\Component\DependencyInjection\Container @group DependencyInjection
Namespace
Drupal\Tests\Component\DependencyInjectionCode
public function testGetForClassFromParameter() {
$container_definition = $this->containerDefinition;
$container_definition['frozen'] = FALSE;
$container = new $this->containerClass($container_definition);
$other_service_class = $this->containerDefinition['parameters']['some_parameter_class'];
$other_service = $container
->get('other.service_class_from_parameter');
$this
->assertInstanceOf($other_service_class, $other_service);
}