Closed
Description
Symfony version: 4.4.5
I'm starting a new project (using SF 4.4 because it's LTS) and in my tests I'd like to use the new feature that enables getting services easily in tests.
However even when doing everything as described on a completely fresh project without any hacks I'm still getting this error:
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: The "MyServiceClass" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead.
The exception stack trace contains vendor/symfony/framework-bundle/Test/TestContainer.php:106
which proves that the "special container" as described in the post is indeed used. But I still can't get the service.
What else do I need to enable to use this feature?