knpuniversity / oauth2-client-bundle

Easily talk to an OAuth2 server for social functionality in Symfony
https://symfonycasts.com
MIT License
777 stars 146 forks source link

Unable to do functional tests with PHPUnit since upgrading to new auth system #432

Open mike240se opened 7 months ago

mike240se commented 7 months ago

I recently upgraded both the bundle and sf to 6.4, in the process I had to get rid of the guard system and switch to the new authentication system which works fine.

However, my webtestcases no longer work and throw errors of "ErrorException: No route found for "GET https://login.microsoftonline.com/tenantID/oauth2/authorize" (from "http://localhost/login") in /app/vendor/symfony/http-kernel/EventListener/RouterListener.php:127"

I have switched over to the new ->login() method for logging in a user in a webtestcase, but still throws this error. Not really sure if this is a config error, a bug or an issue with my test code.

I ASSUME the issue is the user is not being logged with $this->client->loginUser($user); and that is triggering oauth in the test but I am not certain. I couldnt find any docs on how to test with this bundle, does anyone have any examples they can share?