function ServiceLocatorTestCase::testThrowsOnUndefinedInternalService
File
-
vendor/
symfony/ service-contracts/ Test/ ServiceLocatorTestCase.php, line 69
Class
Namespace
Symfony\Contracts\Service\TestCode
public function testThrowsOnUndefinedInternalService() {
$locator = $this->getServiceLocator([
'foo' => function () use (&$locator) {
return $locator->get('bar');
},
]);
if (!$this->getExpectedException()) {
$this->expectException(NotFoundExceptionInterface::class);
$this->expectExceptionMessage('The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.');
}
$locator->get('foo');
}