public function testShouldReturnTokenInfo() { $wantedTokens = ['access_token' => '1/abdef1234567890', 'expires_in' => '57', 'token_type' => 'Bearer']; $jsonTokens = json_encode($wantedTokens); $httpHandler = getHandler([buildResponse(200, [GCECredentials::FLAVOR_HEADER => 'Google']), buildResponse(200, [], Psr7\stream_for($jsonTokens))]); $g = new GCECredentials(); $this->assertEquals($wantedTokens, $g->fetchAuthToken($httpHandler)); }