diff options
author | tailor <harningt@gmail.com> | 2008-02-02 06:53:07 +0000 |
---|---|---|
committer | tailor <harningt@gmail.com> | 2008-02-02 06:53:07 +0000 |
commit | b410be8526d0673be852787a482455e57268b0ed (patch) | |
tree | 4f0d5685948a4f1ef3bd1244115a4f848db4c766 | |
parent | eaad8555902fdbd659e3a9121f6cde8ccab42236 (diff) | |
download | php-openid-b410be8526d0673be852787a482455e57268b0ed.zip php-openid-b410be8526d0673be852787a482455e57268b0ed.tar.gz php-openid-b410be8526d0673be852787a482455e57268b0ed.tar.bz2 |
[project @ hmac-sha256-test]
-rw-r--r-- | Tests/Auth/OpenID/Association.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/Auth/OpenID/Association.php b/Tests/Auth/OpenID/Association.php index fcdda0d..61d3e71 100644 --- a/Tests/Auth/OpenID/Association.php +++ b/Tests/Auth/OpenID/Association.php @@ -33,6 +33,23 @@ class Tests_Auth_OpenID_Association extends PHPUnit_TestCase { $this->assertTrue($assoc2->equal($assoc)); } } + function test_me256() + { + if(!Auth_OpenID_HMACSHA256_SUPPORTED) return; + $issued = time(); + $lifetime = 600; + $assoc = new Auth_OpenID_Association('handle', 'secret', $issued, + $lifetime, 'HMAC-SHA256'); + $s = $assoc->serialize(); + $assoc2 = Auth_OpenID_Association::deserialize( + 'Auth_OpenID_Association', $s); + + if ($assoc2 === null) { + $this->fail('deserialize returned null'); + } else { + $this->assertTrue($assoc2->equal($assoc)); + } + } } ?> |