KnpU\OAuth2ClientBundle\Tests\Security\Authenticator\StubSocialAuthenticator::doFetchAccessToken PHP Method

doFetchAccessToken() public method

public doFetchAccessToken ( OAuth2Client $client )
$client KnpU\OAuth2ClientBundle\Client\OAuth2Client
    public function doFetchAccessToken(OAuth2Client $client)
    {
        return $this->fetchAccessToken($client);
    }

Usage Example

 /**
  * @expectedException \KnpU\OAuth2ClientBundle\Security\Exception\NoAuthCodeAuthenticationException
  */
 public function testFetchAccessTokenThrowsAuthenticationException()
 {
     $authenticator = new StubSocialAuthenticator();
     $client = $this->prophesize('KnpU\\OAuth2ClientBundle\\Client\\OAuth2Client');
     $client->getAccessToken()->willThrow(new MissingAuthorizationCodeException());
     $authenticator->doFetchAccessToken($client->reveal());
 }