public function credentialsProvider()
{
$config = ['authHttpHandler' => function ($request, $options = []) {
return new Response(200, [], json_encode(['access_token' => 'abc']));
}, 'httpHandler' => function ($request, $options = []) {
return new Response(200, []);
}];
$keyFilePath = __DIR__ . '/fixtures/json-key-fixture.json';
putenv("GOOGLE_APPLICATION_CREDENTIALS={$keyFilePath}");
// for application default credentials
$credentialsFetcher = $this->prophesize('Google\\Auth\\FetchAuthTokenInterface');
$credentialsFetcher->fetchAuthToken(Argument::any())->willReturn(['access_token' => 'abc']);
return [[$config + ['keyFile' => json_decode(file_get_contents($keyFilePath), true)]], [$config + ['keyFilePath' => $keyFilePath]], [$config + ['credentialsFetcher' => $credentialsFetcher->reveal()]], [$config]];
}