Announcements

Help Wizard

Step 1

NEXT STEP

How to unit test?

How to unit test?

I'm making a small SDK (PHP), and I want to write some unit tests for the authorization, but also for the web api endpoints.

 

I'm stuck at getting the authorization code, and consequentially the access & refresh tokens. I have all my secrets in my test class but I can't figure out the "fetch access token" request. Right now the SDK generates the url and returns it, and the frontend makes a request there, interacts with the Spotify prompt and gets redirected back with the authorization code.

 

The frontend then makes a request to the backend with the authorization code and the backend calls the "fetch access token" method from the SDK.

 

This is where I'm stuck and what I wanna figure out how to do in the unit test class.

 

Thank you in advance

 

 

Reply
0 Replies

Suggested posts

Let's introduce ourselves!

Hey there you, ย  Yeah, you!ย 😁 ย  Welcome - we're glad you joined the Spotify Community! ย  While you here, let's have a fun game and getโ€ฆ

ModeratorStaff / Moderator/ 4 years ago  in Social & Random