Closed
Description
Description
Since 4.1 we can access private services in tests but we cannot substitute any services with mocks, as may be required by some testing strategies.
Example
self::$container->set('foo', new MockedFoo());
Symfony\Component\DependencyInjection\Exception\InvalidArgumentException : The "foo" service is private, you cannot replace it.
vendor\symfony\dependency-injection\Container.php:163
vendor\symfony\framework-bundle\Test\TestContainer.php:86
Metadata
Metadata
Assignees
Labels
No labels