diff options
author | Joseph Warner <hardolaf@hardolaf.com> | 2013-07-24 15:56:52 -0400 |
---|---|---|
committer | Joseph Warner <hardolaf@hardolaf.com> | 2013-07-24 15:57:06 -0400 |
commit | d1f0ecca453cb80509ba145863195816d8978f41 (patch) | |
tree | 1b1709515b12bb3f4f0784cddd5e3fd6fff28ce1 /tests/auth | |
parent | 69d8149a8f9bf5ea6f88a3221cedf8307d88dadf (diff) | |
download | forums-d1f0ecca453cb80509ba145863195816d8978f41.tar forums-d1f0ecca453cb80509ba145863195816d8978f41.tar.gz forums-d1f0ecca453cb80509ba145863195816d8978f41.tar.bz2 forums-d1f0ecca453cb80509ba145863195816d8978f41.tar.xz forums-d1f0ecca453cb80509ba145863195816d8978f41.zip |
[feature/oauth] Has Access Token test
PHPBB3-11673
Diffstat (limited to 'tests/auth')
-rw-r--r-- | tests/auth/provider_oauth_token_storage_test.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/auth/provider_oauth_token_storage_test.php b/tests/auth/provider_oauth_token_storage_test.php index fc4a9af741..eb489410c7 100644 --- a/tests/auth/provider_oauth_token_storage_test.php +++ b/tests/auth/provider_oauth_token_storage_test.php @@ -94,9 +94,26 @@ class phpbb_auth_provider_oauth_token_storage_test extends phpbb_database_test_c $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() |