Skip to content

Commit

Permalink
use FakeHttpClient in refresh token test
Browse files Browse the repository at this point in the history
  • Loading branch information
aaemnnosttv committed Nov 8, 2019
1 parent d04397d commit 3857701
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Google\Site_Kit\Context;
use Google\Site_Kit\Core\Authentication\Clients\OAuth_Client;
use Google\Site_Kit\Tests\Exception\RedirectException;
use Google\Site_Kit\Tests\FakeHttpClient;
use Google\Site_Kit\Tests\TestCase;

/**
Expand Down Expand Up @@ -50,7 +51,7 @@ public function test_refresh_token() {
// Google client must be initialized first
$this->assertEquals( 'refresh_token_not_exist', get_user_option( OAuth_Client::OPTION_ERROR_CODE, $user_id ) );

$client->get_client();
$client->get_client()->setHttpClient( new FakeHttpClient() );
$client->refresh_token();

// At this point an error is triggered internally due to undefined indexes on $authentication_token
Expand Down

0 comments on commit 3857701

Please sign in to comment.