Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rognales's avatar

Testing Custom User Provider

I have implemented custom user provider by extending the EloquentUserProvider and overridden theretrieveByCredentials and validateCredentials. This provider will call external API.

This implementation is working as expected.

Now comes testing time. I'm not sure how to mock the auth and return a prepared response.

I intend to use actingAs() too for HTTP test.

0 likes
0 replies

Please or to participate in this conversation.