-
Notifications
You must be signed in to change notification settings - Fork 1
Container
Gerard Rico Botella edited this page Nov 9, 2019
·
2 revisions
$service = $this->getContainer()->get('desired.service');
$parameter = $this->getContainer()->getParameter('desired.parameter');
$service = $this->getTestContainer()->get('desired.private.service);
Symfony removes private services that are not in use. If you try to get any of those services, you will get the following error:
The "unused_private_service" service or alias has been removed or inlined when the container was compiled.
To prevent the service to be removed, add it to the unused_services array in configuration:
functional_test:
unused_definitions:
- 'unused_private_service'