-
Notifications
You must be signed in to change notification settings - Fork 940
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct issue with Google refreshToken() method. (#686)
* fix: default to known refresh token on Google refresh * test: assert refresh token works on Google refresh
- Loading branch information
1 parent
05af22c
commit d2a8113
Showing
3 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
namespace Laravel\Socialite\Tests\Fixtures; | ||
|
||
use Laravel\Socialite\Two\GoogleProvider; | ||
use Laravel\Socialite\Two\User; | ||
use Mockery as m; | ||
use stdClass; | ||
|
||
class GoogleTestProviderStub extends GoogleProvider | ||
{ | ||
/** | ||
* @var \GuzzleHttp\Client|\Mockery\MockInterface | ||
*/ | ||
public $http; | ||
|
||
protected function getAuthUrl($state) | ||
{ | ||
return $this->buildAuthUrlFromBase('http://auth.url', $state); | ||
} | ||
|
||
protected function getTokenUrl() | ||
{ | ||
return 'http://token.url'; | ||
} | ||
|
||
protected function getUserByToken($token) | ||
{ | ||
return ['id' => 'foo']; | ||
} | ||
|
||
protected function mapUserToObject(array $user) | ||
{ | ||
return (new User)->map(['id' => $user['id']]); | ||
} | ||
|
||
/** | ||
* Get a fresh instance of the Guzzle HTTP client. | ||
* | ||
* @return \GuzzleHttp\Client|\Mockery\MockInterface | ||
*/ | ||
protected function getHttpClient() | ||
{ | ||
if ($this->http) { | ||
return $this->http; | ||
} | ||
|
||
return $this->http = m::mock(stdClass::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters