So after a couple days of fighting to convert a ton of Guzzle Client mock tests to use the new Laravel Facade we've implemented, I am now running into cURL errors when I try to run our tests package.
The structure we're implementing is a base abstract class that wraps the new HTTP facade and outlines the various verbs, GET, POST, etc. Child services then extend this and can just call the verb and pass params. I can't for the life of me find an easy way to test this. Initially I would set up an HTTP::fake() --
Http::fake([
'*' => Http::response(
self::RESPONSE, 200
)
]);
and then call my service method
$this->serviceClass->getData(self::TEST_ID);
$this->assertEquals($response, self::TEST_ID);
In this case, the "getData" method may do some things but ends up just calling "httpGet" from the base class. While these appear to work locally they are actually trying to hit the route once they get back to the abstract class. I have to be missing something re: the fake() http instance. Perhaps I need to also create a mock abstract class method?