I'm not a testing guru but I think you need to mock responses and assert the package api returns what you're expecting.
How to test my package?
I maintain several packages that are available for download via composer. To my shame, most of these do not have tests, despite me using them extensively in my day to day activities. Reason is simple: I don't know how to make them work properly.
For example: my most used package is ixudra/curl, a package for easily sending cURL requests through a fluent query builder. Ideally, I'd want to set up tests that cover all different methods and options, such as GET requests, POST requests, file upload, various header types, ... but I have no idea how to do this. I can't just use random websites, I'll be fixing my tests all the time if they change their interface. I could set up a website myself and provide all the required routes but that just seems silly
How could I best tackle this issue? How can I write reliable tests without external dependencies?
Thx
Please or to participate in this conversation.