saloonphp / saloon

🤠 Build beautiful API integrations and SDKs with Saloon
https://docs.saloon.dev
MIT License
2.03k stars 105 forks source link

Faking a response - failed to match url #373

Closed diogogomeswww closed 3 months ago

diogogomeswww commented 6 months ago

First of all: thank you for your lovely package!

2 Questions:

  1. I'm using the Laravel HTTP plugin. So I was excepting not having to change my current tests where I'm using HTTP::fake. But I had to change all of them and use the MockClient approach.

  2. On my previous implementation using the HTTP::fake I was explicitly setting a full URL with all the parameters for a GET request. But with Saloon this is not possible. I was checking the implementation and it seems that you only check the url, and do not append the query params. So, it's not possible to check if we are passing the correct parameters to the endpoint. Happy to do a PR to add this if you want.

Sammyjo20 commented 6 months ago

Hey @diogogomeswww thank you for the compliment! ❤️

  1. The only benefit of using the Laravel HTTP Sender is the Laravel Telescope support. Otherwise, I don't think it provides as much value as I initially hoped it would - I will probably be deprecating this package in the future as I am working on a Saloon-replacement to Telescope.

  2. I'll see what I can do here! I am slightly worried about the breaking change suddenly expecting query parameters, but I'll see if I can get it working for you.

Sammyjo20 commented 3 months ago

Hey @diogogomeswww I'm going to close this issue as it has been inactive for a little while, just doing some spring cleaning. Feel free to reopen if you have anything to add.