[Socialite] Need help testing controller method that uses Socialite's userFromToken #37863
Unanswered
furatamasensei
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have been looking for about a week and did some trial and errors but still can't find any solution for this. All I want to do is to assert the returned response from the endpoint that points to a method
loginDriver
inside myAuthController
, but the Socialite implementation was triggered and throws an exception.The implementation works when I test it manually using real device but I need it to be tested via PHPUnit.
I went to the docs about Mocking, but I'm not sure what to put in
shouldReceive
for this to work. To help you get a better idea, please have a look at my implementation.Any kind of help would be very appreciated.
AuthTest.php
AuthController.php
RequestLoginDriver.php
Beta Was this translation helpful? Give feedback.
All reactions