mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-22 21:19:46 +05:30
Test for setAuthTokenTTL
This commit is contained in:
parent
56b8b7c64e
commit
0b927ddfbb
@ -20,6 +20,20 @@ class Auth_Code_Grant_Test extends PHPUnit_Framework_TestCase
|
||||
return new OAuth2\AuthServer($this->client, $this->session, $this->scope);
|
||||
}
|
||||
|
||||
public function test_setAuthTokenTTL()
|
||||
{
|
||||
$a = $this->returnDefault();
|
||||
$grant = new OAuth2\Grant\AuthCode($a);
|
||||
$grant->setAuthTokenTTL(30);
|
||||
|
||||
$reflector = new ReflectionClass($grant);
|
||||
$requestProperty = $reflector->getProperty('authTokenTTL');
|
||||
$requestProperty->setAccessible(true);
|
||||
$v = $requestProperty->getValue($grant);
|
||||
|
||||
$this->assertEquals(30, $v);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException OAuth2\Exception\ClientException
|
||||
* @expectedExceptionCode 0
|
||||
|
Loading…
Reference in New Issue
Block a user