summaryrefslogtreecommitdiffstats
path: root/Tests/Auth/OpenID
diff options
context:
space:
mode:
authorKevin Turner <kevin@janrain.com>2008-06-04 22:10:37 +0000
committerKevin Turner <kevin@janrain.com>2008-06-04 22:10:37 +0000
commitac100f4cc2355639d2535ceaac4d83fe64e70d18 (patch)
tree6bd64eef0aa5c3b4c02a0b3df96756576ecd7af5 /Tests/Auth/OpenID
parent9329fbee6bb25ecb98b9091141caf299fc8ed4cf (diff)
downloadphp-openid-ac100f4cc2355639d2535ceaac4d83fe64e70d18.zip
php-openid-ac100f4cc2355639d2535ceaac4d83fe64e70d18.tar.gz
php-openid-ac100f4cc2355639d2535ceaac4d83fe64e70d18.tar.bz2
[project @ #224: Tests_Auth_OpenID_CheckID: more test cases for missing trust_root/realm]
Diffstat (limited to 'Tests/Auth/OpenID')
-rw-r--r--Tests/Auth/OpenID/Server.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/Tests/Auth/OpenID/Server.php b/Tests/Auth/OpenID/Server.php
index 31ca542..b50be6a 100644
--- a/Tests/Auth/OpenID/Server.php
+++ b/Tests/Auth/OpenID/Server.php
@@ -1111,6 +1111,36 @@ class Tests_Auth_OpenID_CheckID extends PHPUnit_TestCase {
$this->_expectAnswer($answer, $selected_id);
}
+ function test_fromMessageWithoutTrustRoot()
+ {
+ $msg = new Auth_OpenID_Message(Auth_OpenID_OPENID2_NS);;
+ $msg->setArg(Auth_OpenID_OPENID_NS, 'mode', 'checkid_setup');
+ $msg->setArg(Auth_OpenID_OPENID_NS, 'return_to',
+ 'http://real_trust_root/foo');
+ $msg->setArg(Auth_OpenID_OPENID_NS, 'assoc_handle', 'bogus');
+ $msg->setArg(Auth_OpenID_OPENID_NS, 'identity', 'george');
+ $msg->setArg(Auth_OpenID_OPENID_NS, 'claimed_id', 'george');
+
+ $result = Auth_OpenID_CheckIDRequest::fromMessage(
+ $msg, $this->server->op_endpoint);
+
+ $this->assertEquals($result->trust_root,
+ 'http://real_trust_root/foo');
+ }
+
+ function test_fromMessageWithoutTrustRootOrReturnTo()
+ {
+ $msg = new Auth_OpenID_Message(Auth_OpenID_OPENID2_NS);
+ $msg->setArg(Auth_OpenID_OPENID_NS, 'mode', 'checkid_setup');
+ $msg->setArg(Auth_OpenID_OPENID_NS, 'assoc_handle', 'bogus');
+ $msg->setArg(Auth_OpenID_OPENID_NS, 'identity', 'george');
+ $msg->setArg(Auth_OpenID_OPENID_NS, 'claimed_id', 'george');
+
+ $result = Auth_OpenID_CheckIDRequest::fromMessage(
+ $msg, $this->server);
+ $this->assertTrue(is_a($result, 'Auth_OpenID_ServerError'));
+ }
+
function test_answerAllowWithDelegatedIdentityOpenID2()
{
// Answer an IDENTIFIER_SELECT case with a delegated