mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
[feature/oauth] Has Access Token test
PHPBB3-11673
This commit is contained in:
parent
69d8149a8f
commit
d1f0ecca45
1 changed files with 18 additions and 1 deletions
|
@ -94,9 +94,26 @@ class phpbb_auth_provider_oauth_token_storage_test extends phpbb_database_test_c
|
||||||
$this->assertEquals(serialize($token), $row['oauth_token']);
|
$this->assertEquals(serialize($token), $row['oauth_token']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_hasAccessToken()
|
public static function hasAccessToken_data()
|
||||||
{
|
{
|
||||||
|
return array(
|
||||||
|
array(null, false),
|
||||||
|
array(new StdOAuth2Token('access', 'refresh', StdOAuth2Token::EOL_NEVER_EXPIRES, array('extra' => 'param') ), true),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dataProvider hasAccessToken_data
|
||||||
|
*/
|
||||||
|
public function test_hasAccessToken($token, $expected)
|
||||||
|
{
|
||||||
|
if ($token)
|
||||||
|
{
|
||||||
|
$this->token_storage->storeAccessToken($token);
|
||||||
|
}
|
||||||
|
|
||||||
|
$has_access_token = $this->token_storage->hasAccessToken();
|
||||||
|
$this->assertEquals($expected, $has_access_token);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_clearToken()
|
public function test_clearToken()
|
||||||
|
|
Loading…
Add table
Reference in a new issue