public function testTokenCanBeCreated()
 {
     $token = Token::create(getenv("TRAKT_ACCESS_TOKEN"), getenv("TRAKT_TOKEN_TYPE"), getenv("TRAKT_EXPIRES_IN"), getenv("TRAKT_REFRESH_TOKEN"), getenv("TRAKT_SCOPE"));
     $this->assertEquals(getenv("TRAKT_ACCESS_TOKEN"), $token->accessToken);
     $this->assertEquals(time() + (int) getenv("TRAKT_EXPIRES_IN"), $token->expires);
     $this->assertEquals(getenv("TRAKT_REFRESH_TOKEN"), $token->refreshToken);
 }
Exemplo n.º 2
0
/**
 * @return \League\OAuth2\Client\Token\AccessToken
 */
function get_token()
{
    return Token::create(getenv("TRAKT_ACCESS_TOKEN"), getenv("TRAKT_TOKEN_TYPE"), getenv("TRAKT_EXPIRES_IN"), getenv("TRAKT_REFRESH_TOKEN"), getenv("TRAKT_SCOPE"));
}
Exemplo n.º 3
0
 public function createToken($token, $type, $expires, $refresh, $scope)
 {
     return Token::create($token, $type, $expires, $refresh, $scope);
 }