Skip to content

Commit 73d95dd

Browse files
Update ServicesAssertionsTrait.php
1 parent 5489c7d commit 73d95dd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Codeception/Module/Symfony/ServicesAssertionsTrait.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ trait ServicesAssertionsTrait
2424
public function grabService(string $serviceId): object
2525
{
2626
if (!$service = $this->getService($serviceId)) {
27-
$this->fail("Service `{$serviceId}` is required by Codeception, but not loaded by Symfony since you're not using it anywhere in your app.\n
28-
Recommended 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
29-
Besides, `test` needs to be set to `true` in your `config/packages/framework.php`/`.yaml`, see https://symfony.com/doc/current/reference/configuration/framework.html#test");
27+
$this->fail("Service `{$serviceId}` is required by Codeception, but not loaded by Symfony. Possible solutions:\n
28+
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
29+
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
30+
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");
3031
}
3132

3233
return $service;

0 commit comments

Comments
 (0)