diff options
author | tailor <cygnus@janrain.com> | 2007-02-01 21:29:16 +0000 |
---|---|---|
committer | tailor <cygnus@janrain.com> | 2007-02-01 21:29:16 +0000 |
commit | fc6af05b581732bef9f4bd8da9feef5d008be350 (patch) | |
tree | 63f54202b81d520d2db4a962e9d60349771f81df | |
parent | 4880f77b8c323fd5c52d7d9fc2fe9c97779a7895 (diff) | |
download | php-openid-fc6af05b581732bef9f4bd8da9feef5d008be350.zip php-openid-fc6af05b581732bef9f4bd8da9feef5d008be350.tar.gz php-openid-fc6af05b581732bef9f4bd8da9feef5d008be350.tar.bz2 |
[project @ Update tests, add checkidSetupNoIdentityOpenID2]
-rw-r--r-- | Tests/Auth/OpenID/Server.php | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/Tests/Auth/OpenID/Server.php b/Tests/Auth/OpenID/Server.php index 2b33243..66c2ef2 100644 --- a/Tests/Auth/OpenID/Server.php +++ b/Tests/Auth/OpenID/Server.php @@ -213,21 +213,37 @@ class Tests_Auth_OpenID_Test_Decode extends PHPUnit_TestCase { $this->assertEquals($r->return_to, $this->rt_url); } - function test_checkidSetupNoIdentity() + function test_checkidSetupNoClaimedIDOpenID2() { $args = array( + 'openid.ns' => Auth_OpenID_OPENID2_NS, 'openid.mode' => 'checkid_setup', + 'openid.identity' => $this->id_url, 'openid.assoc_handle' => $this->assoc_handle, 'openid.return_to' => $this->rt_url, - 'openid.trust_root' => $this->tr_url); + 'openid.realm' => $this->tr_url + ); $result = $this->decoder->decode($args); - if (Auth_OpenID_isError($result)) { - $this->assertTrue($result->message); - } else { - $this->fail(sprintf("Expected Auth_OpenID_Error, instead " . - "returned with %s", gettype($result))); - } + $this->assertTrue(is_a($result, "Auth_OpenID_ServerError")); + } + + function test_checkidSetupNoIdentityOpenID2() + { + $args = array( + 'openid.ns' => Auth_OpenID_OPENID2_NS, + 'openid.mode' => 'checkid_setup', + 'openid.assoc_handle' => $this->assoc_handle, + 'openid.return_to' => $this->rt_url, + 'openid.realm' => $this->tr_url); + + $r = $this->decoder->decode($args); + $this->assertTrue(is_a($r, 'Auth_OpenID_CheckIDRequest')); + $this->assertEquals($r->mode, "checkid_setup"); + $this->assertEquals($r->immediate, false); + $this->assertEquals($r->identity, null); + $this->assertEquals($r->trust_root, $this->tr_url); + $this->assertEquals($r->return_to, $this->rt_url); } function test_checkidSetupNoReturn() |