summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2007-10-02 21:44:55 +0000
committertailor <cygnus@janrain.com>2007-10-02 21:44:55 +0000
commita0105bf1d27dac272c3ec2b4828a8b9f237ad998 (patch)
tree73f648ce67bdfab8d04606a9fde6803e2eb297c3 /Tests
parentd0e34d4c4ccacdaeb427e9f8575743445d7065d5 (diff)
downloadphp-openid-a0105bf1d27dac272c3ec2b4828a8b9f237ad998.zip
php-openid-a0105bf1d27dac272c3ec2b4828a8b9f237ad998.tar.gz
php-openid-a0105bf1d27dac272c3ec2b4828a8b9f237ad998.tar.bz2
[project @ Auth_OpenID_Consumer: OpenID 2 draft 12 fragment handling]
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Auth/OpenID/VerifyDisco.php35
1 files changed, 34 insertions, 1 deletions
diff --git a/Tests/Auth/OpenID/VerifyDisco.php b/Tests/Auth/OpenID/VerifyDisco.php
index a3a6277..a95a4d3 100644
--- a/Tests/Auth/OpenID/VerifyDisco.php
+++ b/Tests/Auth/OpenID/VerifyDisco.php
@@ -150,6 +150,33 @@ class Tests_Auth_OpenID_VerifyDisco extends OpenIDTestMixin {
$this->failUnlessProtocolError(
$this->consumer->_verifyDiscoveryResults($msg, $endpoint));
}
+
+ function test_openid2Fragment()
+ {
+ $claimed_id = "http://unittest.invalid/";
+ $claimed_id_frag = $claimed_id . "#fragment";
+
+ $endpoint = new Auth_OpenID_ServiceEndpoint();
+ $endpoint->local_id = 'my identity';
+ $endpoint->claimed_id = $claimed_id;
+ $endpoint->server_url = 'Phone Home';
+ $endpoint->type_uris = array(Auth_OpenID_TYPE_2_0);
+
+ $msg = Auth_OpenID_Message::fromOpenIDArgs(
+ array('ns' => Auth_OpenID_OPENID2_NS,
+ 'identity' => $endpoint->local_id,
+ 'claimed_id' => $claimed_id_frag,
+ 'op_endpoint' => $endpoint->server_url));
+ $result = $this->consumer->_verifyDiscoveryResults($msg, $endpoint);
+
+ $this->assertEquals($result->local_id, $endpoint->local_id);
+ $this->assertEquals($result->server_url, $endpoint->server_url);
+
+ $this->assertEquals($result->type_uris, $endpoint->type_uris);
+
+ $this->assertEquals($result->claimed_id, $claimed_id_frag);
+ }
+
}
// XXX: test the implementation of _discoverAndVerify
@@ -178,7 +205,9 @@ class Tests_openID2NoEndpointDoesDisco extends Tests_Auth_OpenID_VerifyDisco {
function test_openID2NoEndpointDoesDisco()
{
$op_endpoint = 'Phone Home';
- $sentinel = 'thing';
+ $this->consumer->sentinel = new Auth_OpenID_ServiceEndpoint();
+ $this->consumer->sentinel->claimed_id = 'monkeysoft';
+
$msg = Auth_OpenID_Message::fromOpenIDArgs(
array('ns' => Auth_OpenID_OPENID2_NS,
'identity' => 'sour grapes',
@@ -199,6 +228,10 @@ class Tests_openID2MismatchedDoesDisco extends Tests_Auth_OpenID_VerifyDisco {
$mismatched->identity = 'nothing special, but different';
$mismatched->local_id = 'green cheese';
+ $sentinel = new Auth_OpenID_ServiceEndpoint();
+ $sentinel->claimed_id = 'monkeysoft';
+ $this->consumer->sentinel = $sentinel;
+
$op_endpoint = 'Phone Home';
$msg = Auth_OpenID_Message::fromOpenIDArgs(