/**
* @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());
}