function ContainerTest::testResolveServicesAndParametersForServiceInstantiatedFromParameter
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php \Drupal\Tests\Component\DependencyInjection\ContainerTest::testResolveServicesAndParametersForServiceInstantiatedFromParameter()
- 10 core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php \Drupal\Tests\Component\DependencyInjection\ContainerTest::testResolveServicesAndParametersForServiceInstantiatedFromParameter()
- 9 core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php \Drupal\Tests\Component\DependencyInjection\ContainerTest::testResolveServicesAndParametersForServiceInstantiatedFromParameter()
- 8.9.x core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php \Drupal\Tests\Component\DependencyInjection\ContainerTest::testResolveServicesAndParametersForServiceInstantiatedFromParameter()
Tests that a parameter that points to a service works correctly.
See also
::get
::createService
::resolveServicesAndParameters
File
-
core/
tests/ Drupal/ Tests/ Component/ DependencyInjection/ ContainerTest.php, line 614
Class
Namespace
Drupal\Tests\Component\DependencyInjectionCode
public function testResolveServicesAndParametersForServiceInstantiatedFromParameter() : void {
$service = $this->container
->get('service.provider');
$test_service = $this->container
->get('service_with_parameter_service');
$this->assertSame($service, $test_service->getSomeOtherService(), 'Service was passed via parameter.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.