Maybe some type of mocking API service would be the best way
I was hoping that the Http::fake() was what I was looking for, but it was sadly only for mocking the laravel http client :(
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
So I know that you shouldn't test external APIs, but how do you test your own code when it relies on external APIs and do a lot of stuff? I do not want to not test my part here.
In my case I'm using discord and this library restcord/restcord. But I don't want to be stuck with going through all my code and manually test it against the real discord each time I do changes.
Example, my main dashboard view, I want to know that I can view it fine, but this does a minimum of 3 API calls to discord before it's cached.
Please or to participate in this conversation.