diff options
author | tailor <chowells@janrain.com> | 2008-06-05 01:11:59 +0000 |
---|---|---|
committer | tailor <chowells@janrain.com> | 2008-06-05 01:11:59 +0000 |
commit | 89068d2d799fd86980609f502c59a601bfad3c79 (patch) | |
tree | be7ff5895f9aa22184552caf939c5410d7c13dd6 | |
parent | 1f01cbb363cc9422a6ed27178a4696c257070543 (diff) | |
download | php-openid-89068d2d799fd86980609f502c59a601bfad3c79.zip php-openid-89068d2d799fd86980609f502c59a601bfad3c79.tar.gz php-openid-89068d2d799fd86980609f502c59a601bfad3c79.tar.bz2 |
[project @ #204 MalformedTrustRoot returned by the library now gets passed the OpenID Message object instead of null]
-rw-r--r-- | Auth/OpenID/Server.php | 3 | ||||
-rw-r--r-- | Tests/Auth/OpenID/Server.php | 12 |
2 files changed, 14 insertions, 1 deletions
diff --git a/Auth/OpenID/Server.php b/Auth/OpenID/Server.php index e43ccc4..1f53044 100644 --- a/Auth/OpenID/Server.php +++ b/Auth/OpenID/Server.php @@ -908,7 +908,8 @@ class Auth_OpenID_CheckIDRequest extends Auth_OpenID_Request { $tr = Auth_OpenID_TrustRoot::_parse($this->trust_root); if ($tr === false) { - return new Auth_OpenID_MalformedTrustRoot(null, $this->trust_root); + return new Auth_OpenID_MalformedTrustRoot($this->message, + $this->trust_root); } if ($this->return_to !== null) { diff --git a/Tests/Auth/OpenID/Server.php b/Tests/Auth/OpenID/Server.php index 152442f..cddcb8e 100644 --- a/Tests/Auth/OpenID/Server.php +++ b/Tests/Auth/OpenID/Server.php @@ -1058,6 +1058,18 @@ class Tests_Auth_OpenID_CheckID extends PHPUnit_TestCase { $this->assertTrue($this->request->trustRootValid()); } + function test_malformedTrustRoot() + { + $this->request->trust_root = "invalid://trust*root/"; + $this->request->return_to = "http://foo.unittest/39"; + $sentinel = 'Sentinel'; + $this->request->message = $sentinel; + + $result = $this->request->trustRootValid(); + $this->assertTrue(Auth_OpenID_isError($result)); + $this->assertEquals($result->message, $sentinel); + } + function _verify($trust_root, $return_to, $value) { $this->assertEquals($this->request->trust_root, $trust_root); |