function ContainerTest::testGetForAliasedService
Tests that Container::get() for aliased services works properly.
@legacy-covers ::get @legacy-covers ::createService
File
-
core/
tests/ Drupal/ Tests/ Component/ DependencyInjection/ ContainerTest.php, line 385
Class
Namespace
Drupal\Tests\Component\DependencyInjectionCode
public function testGetForAliasedService() : void {
$service = $this->container
->get('service.provider');
$aliased_service = $this->container
->get('service.provider_alias');
$this->assertSame($service, $aliased_service);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.