diff options
author | tailor <cygnus@janrain.com> | 2006-02-14 23:55:17 +0000 |
---|---|---|
committer | tailor <cygnus@janrain.com> | 2006-02-14 23:55:17 +0000 |
commit | 1e6f1844a1d17bc067210dfb1a8988917c6ce8a6 (patch) | |
tree | bc489733413d4256e585d8f7f5c01d1f2549dae1 /Tests/Auth | |
parent | ecce27920ed37b53efe31d451b21c94ae90919d8 (diff) | |
download | php-openid-1e6f1844a1d17bc067210dfb1a8988917c6ce8a6.zip php-openid-1e6f1844a1d17bc067210dfb1a8988917c6ce8a6.tar.gz php-openid-1e6f1844a1d17bc067210dfb1a8988917c6ce8a6.tar.bz2 |
[project @ Moved CryptUtil functions into an Auth_OpenID_CryptUtil class.]
Diffstat (limited to 'Tests/Auth')
-rw-r--r-- | Tests/Auth/OpenID/CryptUtil.php | 10 | ||||
-rw-r--r-- | Tests/Auth/OpenID/StoreTest.php | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/Tests/Auth/OpenID/CryptUtil.php b/Tests/Auth/OpenID/CryptUtil.php index a1fcf97..4970023 100644 --- a/Tests/Auth/OpenID/CryptUtil.php +++ b/Tests/Auth/OpenID/CryptUtil.php @@ -21,7 +21,7 @@ class Tests_Auth_OpenID_CryptUtil extends PHPUnit_TestCase { { $cases = array(1, 10, 255); foreach ($cases as $length) { - $data = Auth_OpenID_getBytes($length); + $data = Auth_OpenID_CryptUtil::getBytes($length); $this->assertEquals(strlen($data), $length); } } @@ -31,10 +31,10 @@ class Tests_Auth_OpenID_CryptUtil extends PHPUnit_TestCase { $num_iterations = 100; $data_length = 20; - $data = Auth_OpenID_getBytes($num_iterations); + $data = Auth_OpenID_CryptUtil::getBytes($num_iterations); for ($i = 0; $i < $num_iterations; $i++) { $last = $data; - $data = Auth_OpenID_getBytes($data_length); + $data = Auth_OpenID_CryptUtil::getBytes($data_length); $this->assertFalse($data == $last); } } @@ -44,8 +44,8 @@ class Tests_Auth_OpenID_CryptUtil extends PHPUnit_TestCase { // It's possible, but HIGHLY unlikely that a correct // implementation will fail by returning the same number twice - $s = Auth_OpenID_getBytes(32); - $t = Auth_OpenID_getBytes(32); + $s = Auth_OpenID_CryptUtil::getBytes(32); + $t = Auth_OpenID_CryptUtil::getBytes(32); $this->assertEquals(strlen($s), 32); $this->assertEquals(strlen($t), 32); $this->assertFalse($s == $t); diff --git a/Tests/Auth/OpenID/StoreTest.php b/Tests/Auth/OpenID/StoreTest.php index 11b9bd5..7cac11d 100644 --- a/Tests/Auth/OpenID/StoreTest.php +++ b/Tests/Auth/OpenID/StoreTest.php @@ -66,7 +66,7 @@ class Tests_Auth_OpenID_StoreTest extends PHPUnit_TestCase { */ function generateNonce() { - return Auth_OpenID_randomString(8, $this->allowed_nonce); + return Auth_OpenID_CryptUtil::randomString(8, $this->allowed_nonce); } /** @@ -74,8 +74,8 @@ class Tests_Auth_OpenID_StoreTest extends PHPUnit_TestCase { */ function genAssoc($now, $issued = 0, $lifetime = 600) { - $sec = Auth_OpenID_randomString(20); - $hdl = Auth_OpenID_randomString(128, $this->allowed_handle); + $sec = Auth_OpenID_CryptUtil::randomString(20); + $hdl = Auth_OpenID_CryptUtil::randomString(128, $this->allowed_handle); return new Auth_OpenID_Association($hdl, $sec, $now + $issued, $lifetime, 'HMAC-SHA1'); } |