public function testExpiresIn()
 {
     $this->_token->populate(array(AccessToken::FIELD_EXPIRATION_TIME => new \DateTime('tomorrow')));
     $seconds = $this->_token->expiresIn();
     $this->assertInternalType('integer', $seconds);
     $this->assertGreaterThan(0, $seconds);
 }
 protected function _createTokenEntity(AccessToken $accessToken)
 {
     $tokenFactory = $this->getTokenFactory();
     if (!$tokenFactory instanceof EntityFactoryInterface) {
         throw new GeneralException\MissingDependencyException('token factory');
     }
     return $tokenFactory->createEntity(array(Entity\Token::FIELD_ACCESS_TOKEN => $accessToken->getToken(), Entity\Token::FIELD_TOKEN_TYPE => $accessToken->getType(), Entity\Token::FIELD_EXPIRES_IN => $accessToken->expiresIn(), Entity\Token::FIELD_REFRESH_TOKEN => 'not set', Entity\Token::FIELD_ID_TOKEN => 'not set'));
 }