makapaka's avatar

Testing endpoint with Passport client credentials

My POST endpoints use the ->middleware('client') via Passport.

So in reality, my clients have a client_secret, send that through to /oauth/token and get a token back that they can use in subsequent POST requests.

Question is, how do you do this inside phpunit test cases if, following Jeffrey's testing we use the :memory: DB with sqlite ?

How do I get a client_secret generated in the first place, and then use that in the POST request ?

0 likes
1 reply
makapaka's avatar

so i've been able to disable the middleware via simple $this->withoutMiddleware();, however I still feel like testing the token part is a valid test ?

1 like

Please or to participate in this conversation.