-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
damienalexandre, ek-yrabiller, dsech, tomasliubinas, shubaivan and 1 moreBafS
Metadata
Metadata
Assignees
Labels
No labels