Esempio n. 1
0
 /**
  * Invalidates the bearer token.
  *
  * @param \Widop\Twitter\OAuth\BearerToken $token The bearer token.
  *
  * @throws \RuntimeException If the token was not invalidated.
  */
 public function invalidateBearerToken(BearerToken $token)
 {
     $request = $this->createRequest('/oauth2/invalidate_token');
     $request->setPostParameter('access_token', $token->getValue());
     $this->signRequest($request, new BasicToken());
     $response = $this->sendRequest($request);
     if ($token->getValue() !== $response->getData('access_token')) {
         throw new OAuthException('An error occured when invalidating the bearer token.', $response);
     }
 }
Esempio n. 2
0
 public function testSerialize()
 {
     $token = unserialize(serialize($this->token));
     $this->assertSame($this->token->getValue(), $token->getValue());
 }