Esempio n. 1
0
 /**
  * @return string
  */
 public function getAccessToken()
 {
     if ($this->accessToken === null) {
         $this->accessToken = $at = new AccessToken();
         $at->setApp($this->getApp())->setLogger($this->getLogger())->setCache($this->isCache());
     }
     return $this->accessToken->getToken();
 }
 public function testConstructor()
 {
     $token = new AccessToken('foobar', 10);
     $this->assertInstanceOf('\\DateTime', $token->getExpiresAt());
     $this->assertEquals('foobar', $token->getToken());
     $token = new AccessToken();
     $this->assertNull($token->getExpiresAt());
     $this->assertEmpty($token->getToken());
     $token = new AccessToken(null, new \DateTime('+2minutes'));
     $this->assertInstanceOf('\\DateTime', $token->getExpiresAt());
 }