summaryrefslogtreecommitdiffstats
path: root/Tests/Auth
diff options
context:
space:
mode:
authorJosh Hoyt <josh@janrain.com>2006-01-25 19:54:25 +0000
committerJosh Hoyt <josh@janrain.com>2006-01-25 19:54:25 +0000
commitf7222591468959fcd90fd07d509a8d3f321f0f54 (patch)
treea8d1bf05d9d0a31c0a418c6912315cedefa4052c /Tests/Auth
parente55ae3bec5061231fea8f69d79fc27d41e495fd6 (diff)
downloadphp-openid-f7222591468959fcd90fd07d509a8d3f321f0f54.zip
php-openid-f7222591468959fcd90fd07d509a8d3f321f0f54.tar.gz
php-openid-f7222591468959fcd90fd07d509a8d3f321f0f54.tar.bz2
[project @ Add checkid_setup cancel server test]
Diffstat (limited to 'Tests/Auth')
-rw-r--r--Tests/Auth/OpenID/Server.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/Tests/Auth/OpenID/Server.php b/Tests/Auth/OpenID/Server.php
index 6bdcd32..8c2da24 100644
--- a/Tests/Auth/OpenID/Server.php
+++ b/Tests/Auth/OpenID/Server.php
@@ -178,13 +178,13 @@ class Tests_Auth_OpenID_Server extends PHPUnit_TestCase {
'openid.return_to' => $this->rt_url,
);
$ainfo = new Auth_OpenID_AuthorizationInfo($this->sv_url, $args);
- $ret = $this->server->getAuthResponse(&$ainfo, $authorized);
- return $this->_parseRedirResp($ret);
+ return $this->server->getAuthResponse(&$ainfo, $authorized);
}
function test_checkIdImmediateFailure()
{
- list($base, $query) = $this->_startAuth('checkid_immediate', false);
+ $ret = $this->_startAuth('checkid_immediate', false);
+ list($base, $query) = $this->_parseRedirResp($ret);
$setup_args = array('openid.identity' => $this->id_url,
'openid.mode' => 'checkid_setup',
@@ -201,7 +201,8 @@ class Tests_Auth_OpenID_Server extends PHPUnit_TestCase {
function _checkIDGood($mode)
{
- list($base, $query) = $this->_startAuth($mode, true);
+ $ret = $this->_startAuth($mode, true);
+ list($base, $query) = $this->_parseRedirResp($ret);
$this->assertEquals($base, $this->rt_url);
$this->assertEquals($query['openid.mode'], 'id_res');
$this->assertEquals($query['openid.identity'], $this->id_url);
@@ -244,4 +245,13 @@ class Tests_Auth_OpenID_Server extends PHPUnit_TestCase {
$this->assertEquals($this->tr_url, $info->getTrustRoot());
$this->assertEquals($this->id_url, $info->getIdentityURL());
}
+
+ function test_checkIdSetupCancel()
+ {
+ list($status, $info) = $this->_startAuth('checkid_setup', false);
+ $this->assertEquals(Auth_OpenID_DO_AUTH, $status);
+ list($base, $query) = $this->_parseRedirResp($info->cancel());
+ $this->assertEquals($this->rt_url, $base);
+ $this->assertEquals('cancel', $query['openid.mode']);
+ }
}