diff --git a/tests/Unit/TokenStoreTest.php b/tests/Unit/TokenStoreTest.php index d4f39af..69256cb 100644 --- a/tests/Unit/TokenStoreTest.php +++ b/tests/Unit/TokenStoreTest.php @@ -8,8 +8,11 @@ it('reads and stores a token in cache', function () { + Cache::clear(); Cache::spy(); + Cache::shouldReceive('get')->once()->with('oauth_token_example.comoauthtoken')->once()->andReturn(null); + $accessToken = TokenStore::get( 'https://example.com/oauth/token', new Credentials( @@ -23,6 +26,5 @@ AccessToken::TYPE_QUERY ); - Cache::shouldHaveReceived('get')->once()->with('oauth_token_example.comoauthtoken'); Cache::shouldHaveReceived('put')->once()->with('oauth_token_example.comoauthtoken', $accessToken, 3540); });