summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorKevin Turner <kevin@janrain.com>2008-06-04 22:28:32 +0000
committerKevin Turner <kevin@janrain.com>2008-06-04 22:28:32 +0000
commitfe580046be183271d74a2286b5f67a9507944600 (patch)
tree812a5de485b82d3b4cf23a4fb4d7a0338901dd74 /Tests
parentac100f4cc2355639d2535ceaac4d83fe64e70d18 (diff)
downloadphp-openid-fe580046be183271d74a2286b5f67a9507944600.zip
php-openid-fe580046be183271d74a2286b5f67a9507944600.tar.gz
php-openid-fe580046be183271d74a2286b5f67a9507944600.tar.bz2
[project @ Auth_OpenID_Decoder::decode: make sure Auth_OpenID_ServerError has an Auth_OpenID_Message after encountering invalid OpenID namespace]
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Auth/OpenID/Server.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/Auth/OpenID/Server.php b/Tests/Auth/OpenID/Server.php
index b50be6a..c9efd94 100644
--- a/Tests/Auth/OpenID/Server.php
+++ b/Tests/Auth/OpenID/Server.php
@@ -610,6 +610,23 @@ class Tests_Auth_OpenID_Test_Decode extends PHPUnit_TestCase {
gettype($result)));
}
}
+
+ function test_invalidns()
+ {
+ $args = array('openid.ns' => 'Tuesday',
+ 'openid.mode' => 'associate');
+
+ $result = $this->decoder->decode($args);
+
+ $this->assertTrue(is_a($result, 'Auth_OpenID_ServerError'));
+
+ // Assert that the ProtocolError does have a Message attached
+ // to it, even though the request wasn't a well-formed Message.
+ $this->assertTrue($result->message);
+
+ // The error message contains the bad openid.ns.
+ $this->assertTrue(strpos($result->text, 'Tuesday') != -1);
+ }
}
class Tests_Auth_OpenID_Test_Encode extends PHPUnit_TestCase {