Disclaimer: Doing this in PHP is not as easy as in programming languages which support monkey patching - this project is not yet fully tested, so please use at your own risk!...
Instead of manually mocking API calls for your tests, record HTTP requests and replay them later...
If you run hundreds of tests, you don't want to hit a real API all the time. This slows down your test suite quite a bit. The faster your tests are, the faster you can iterate over code changes.