diff options
author | tailor <cygnus@janrain.com> | 2006-01-18 21:44:59 +0000 |
---|---|---|
committer | tailor <cygnus@janrain.com> | 2006-01-18 21:44:59 +0000 |
commit | 92508969c61ed9da7adc9ca903af91293196eae7 (patch) | |
tree | 275ed75c68d86bb9cf25ccd50c0d332e03c548ae /Tests/Auth/OpenID/StoreTest.php | |
parent | a21e46a21ab394d524e93c977d8fee78fa24a70a (diff) | |
download | php-openid-92508969c61ed9da7adc9ca903af91293196eae7.zip php-openid-92508969c61ed9da7adc9ca903af91293196eae7.tar.gz php-openid-92508969c61ed9da7adc9ca903af91293196eae7.tar.bz2 |
[project @ Cleaned up store test code]
Diffstat (limited to 'Tests/Auth/OpenID/StoreTest.php')
-rw-r--r-- | Tests/Auth/OpenID/StoreTest.php | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/Tests/Auth/OpenID/StoreTest.php b/Tests/Auth/OpenID/StoreTest.php index 658da9b..8243d90 100644 --- a/Tests/Auth/OpenID/StoreTest.php +++ b/Tests/Auth/OpenID/StoreTest.php @@ -45,7 +45,7 @@ class Tests_Auth_OpenID_StoreTest extends PHPUnit_TestCase { $lifetime, 'HMAC-SHA1'); } - function _checkRetrieve(&$store, $url, $handle, $expected, $name=null) + function _checkRetrieve(&$store, $url, $handle, $expected, $name = null) { $retrieved_assoc = $store->getAssociation($url, $handle); if (($expected === null) || ($store->isDumb())) { @@ -56,8 +56,8 @@ class Tests_Auth_OpenID_StoreTest extends PHPUnit_TestCase { $this->fail("$name: Got null when expecting " . $expected->serialize()); } else { - $this->assertEquals($retrieved_assoc->serialize(), - $expected->serialize(), $name); + $this->assertEquals($expected->serialize(), + $retrieved_assoc->serialize(), $name); } } } @@ -138,10 +138,10 @@ returned.'); 'Plus we can retrieve the association with the later expiration explicitly'); - // More recent, but expires earlier than assoc2 or assoc $assoc3 = $this->genAssoc($now, $issued = 2, $lifetime = 100); $store->storeAssociation($server_url, $assoc3); + // More recent issued time, so assoc3 is expected. $this->_checkRetrieve($store, $server_url, null, $assoc3, "(1)"); $this->_checkRetrieve($store, $server_url, $assoc->handle, @@ -290,11 +290,17 @@ explicitly'); $db =& DB::connect($dsn); if (PEAR::isError($db)) { - $this->fail("Database connection failed"); + $this->fail("PostgreSQL database connection failed"); return; } $store =& new Auth_OpenID_PostgreSQLStore($db); + $store->createTables(); + // Once unique database names are used, this won't be + // necessary. + $store->reset(); + $this->_testStore($store); + $this->_testNonce($store); } function test_sqlitestore() |