summaryrefslogtreecommitdiffstats
path: root/Tests/Auth
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2006-05-02 18:26:51 +0000
committertailor <cygnus@janrain.com>2006-05-02 18:26:51 +0000
commitb8babfa8396bd2319c732622f95c61bbe4950412 (patch)
treefad24d02f0498af61e44dfb549cf2f2a86670bdc /Tests/Auth
parent5143d8cdb531e446e8b016a94394392485ea31d6 (diff)
downloadphp-openid-b8babfa8396bd2319c732622f95c61bbe4950412.zip
php-openid-b8babfa8396bd2319c732622f95c61bbe4950412.tar.gz
php-openid-b8babfa8396bd2319c732622f95c61bbe4950412.tar.bz2
[project @ More consumer API changes]
Diffstat (limited to 'Tests/Auth')
-rw-r--r--Tests/Auth/OpenID/Consumer.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/Tests/Auth/OpenID/Consumer.php b/Tests/Auth/OpenID/Consumer.php
index 620f46a..f6aa800 100644
--- a/Tests/Auth/OpenID/Consumer.php
+++ b/Tests/Auth/OpenID/Consumer.php
@@ -19,6 +19,7 @@ require_once 'Auth/OpenID/FileStore.php';
require_once 'Auth/OpenID/KVForm.php';
require_once 'Auth/OpenID/Consumer.php';
require_once 'Auth/OpenID/HTTPFetcher.php';
+require_once 'Tests/Auth/OpenID/MemStore.php';
require_once 'PHPUnit.php';
class Auth_OpenID_TestConsumer extends Auth_OpenID_Consumer {
@@ -343,4 +344,35 @@ class Tests_Auth_OpenID_Consumer extends PHPUnit_TestCase {
}
}
+class Tests_Auth_OpenID_Consumer_TestIdRes extends PHPUnit_TestCase {
+ function setUp()
+ {
+ $this->store = new Tests_Auth_OpenID_MemStore();
+ $this->consumer = new Auth_OpenID_GenericConsumer($this->store);
+ $this->return_to = "nonny";
+ $this->server_id = "sirod";
+ $this->server_url = "serlie";
+ $this->consumer_id = "consu";
+ }
+}
+
+class Tests_Auth_OpenID_Consumer_TestSetupNeeded extends Tests_Auth_OpenID_Consumer_TestIdRes {
+ function test_setupNeeded()
+ {
+ $setup_url = "http://unittest/setup-here";
+ $query = array(
+ 'openid.mode' => 'id_res',
+ 'openid.user_setup_url' => $setup_url);
+ $ret = $this->consumer->_doIdRes($query, $this->consumer_id,
+ $this->server_id, $this->server_url);
+ $this->assertEquals($ret->status, 'setup_needed');
+ $this->assertEquals($ret->setup_url, $setup_url);
+ }
+}
+
+// Add other test cases to be run.
+$Tests_Auth_OpenID_Consumer_other = array(
+ new Tests_Auth_OpenID_Consumer_TestSetupNeeded()
+ );
+
?> \ No newline at end of file