public function testGetAccessTokenWithToken()
{
$client = new Client();
$mock = new MockPlugin();
$mock->addResponse(new Response(200));
$client->addSubscriber($mock);
$guzzle3Client = new Guzzle3Client($client);
$api = new Api('foo', $this->clientConfig[0], $this->storage, $guzzle3Client);
$context = new Context('a_user', array('foo', 'bar'));
$accessToken = new AccessToken(array('client_config_id' => 'foo', 'user_id' => 'a_user', 'token_type' => 'bearer', 'access_token' => 'my_token_value', 'scope' => Scope::fromString('foo bar'), 'issue_time' => time() - 100, 'expires_in' => 3600));
$this->storage->storeAccessToken($accessToken);
$accessToken = $api->getAccessToken($context);
$this->assertEquals('my_token_value', $accessToken->getAccessToken());
}