-
Notifications
You must be signed in to change notification settings - Fork 25
cantSeeAuthentication()/dontSeeAuthentication() does not work due to missing service #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We have a test project (codeception/symfony-module-tests) that has tests with this module. I updated this project to Symfony 5.3 using the new security system and according to our tests both methods are working correctly.
The error message gives you a little clue as to what the problem may be. In the case of our test project, we do not have the security service defined as public in a test configuration file |
Thank you for the quick reply. So a workaround would be to inject the service I wonder if there is a way to ensure that the service is always available when using the symfony module. |
I just made the changes in https://github.com/Codeception/symfony-module-tests/pull/19/files Instead of doing a ghost injection of the security service in the app I defined the alias
Regarding this question... I think that, even if there is a way to define that specific service as
So the solution is to improve the error message a bit more so that each user can define the alias for that service himself. I'll close this issue when I have the PR by modifying that documentation. |
I'm using symfony 5.3 and the new authenticator-based security (https://symfony.com/doc/current/security/authenticator_manager.html)
Calling
cantSeeAuthentication()
/dontSeeAuthentication()
fails with the error messageFrom what I can see the service
security.helper
is grabbed directly from the container here: https://github.com/Codeception/module-symfony/blob/main/src/Codeception/Module/Symfony/SecurityAssertionsTrait.php#L180Can anybody confirm this issue?
The text was updated successfully, but these errors were encountered: