@laracoft This could be the way to mock the http.
Http::fake([
'https://example.com/v1/oauth2/token' => Http::response($accessTokenResponse)
]);
My actual controller code has something like this
$response = Http::acceptJson()
->withHeaders([
'Accept-Language' => 'en_US',
'Authorization' => 'Bearer '.$this->accessToken,
])
My test code has something like this
Http::expects('post')->with('https://example.com/v1/oauth2/token')
->andReturns($accessTokenResponse);
Http:: facade is actually Guzzle.Mockery\Exception\BadMethodCallException: Method Mockery_6_Illuminate_Http_Client_Factory::acceptJson() does not exist on this mock object
Http:: in their tests, I checked socialite, cashier-stripe and slack-notification-channelAny examples of using Http:: in tests? Or able to fix what I'm encountering?
Please or to participate in this conversation.