You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Codeception/Module/Symfony/ServicesAssertionsTrait.php
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -11,9 +11,9 @@ trait ServicesAssertionsTrait
11
11
{
12
12
/**
13
13
* Grabs a service from the Symfony dependency injection container (DIC).
14
-
* In "test" environment, Symfony uses a special `test.service_container`.
14
+
* In the "test" environment, Symfony uses a special `test.service_container`.
15
15
* See the "[Public Versus Private Services](https://symfony.com/doc/current/service_container/alias_private.html#marking-services-as-public-private)" documentation.
16
-
* Services that aren't injected somewhere into your app, need to be defined as `public` to be accessible by Codeception.
16
+
* Services that aren't injected anywhere in your app, need to be defined as `public` to be accessible by Codeception.
"Service `{$serviceId}` is required by Codeception, but not loaded by Symfony since you're not using it anywhere in your app.\n
30
-
Recommended solution: Set it to `public` in your `config/services_test.php`/`.yaml`, see https://symfony.com/doc/current/service_container/alias_private.html#marking-services-as-public-private"
31
-
);
28
+
Assert::fail("Service `{$serviceId}` is required by Codeception, but not loaded by Symfony. Possible solutions:\n
29
+
In your `config/packages/framework.php`/`.yaml`, set `test` to `true` (when in test environment), see https://symfony.com/doc/current/reference/configuration/framework.html#test\n
30
+
If you're still getting this message, you're not using that service in your app, so Symfony isn't loading it at all.\n
31
+
Solution: Set it to `public` in your `config/services.php`/`.yaml`, see https://symfony.com/doc/current/service_container/alias_private.html#marking-services-as-public-private\n");
0 commit comments