diff options
author | tailor <dag@janrain.com> | 2008-06-03 23:33:40 +0000 |
---|---|---|
committer | tailor <dag@janrain.com> | 2008-06-03 23:33:40 +0000 |
commit | b7b9e53b067f0f27beb2e795b25e791ef102408c (patch) | |
tree | 966307b0bcfa91450f14084d2ec15dc42e63587f /Tests | |
parent | d97dc4d7dcfa8c8db0c6284934345fb9f45710ba (diff) | |
download | php-openid-b7b9e53b067f0f27beb2e795b25e791ef102408c.zip php-openid-b7b9e53b067f0f27beb2e795b25e791ef102408c.tar.gz php-openid-b7b9e53b067f0f27beb2e795b25e791ef102408c.tar.bz2 |
[project @ AX::FetchResponse::fromSuccessResponse - return null when there's no ax args]
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/Auth/OpenID/AX.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Tests/Auth/OpenID/AX.php b/Tests/Auth/OpenID/AX.php index 9b2aa28..7ed8be3 100644 --- a/Tests/Auth/OpenID/AX.php +++ b/Tests/Auth/OpenID/AX.php @@ -7,6 +7,8 @@ require_once "PHPUnit.php"; require_once "Auth/OpenID/AX.php"; require_once "Auth/OpenID/Message.php"; +require_once "Auth/OpenID/Consumer.php"; +require_once "Auth/OpenID/Server.php"; class BogusAXMessage extends Auth_OpenID_AX_Message { var $mode = 'bogus'; @@ -515,6 +517,12 @@ class FetchRequestTest extends PHPUnit_TestCase { } } +class FauxEndpoint { + function FauxEndpoint() { + $this->claimed_id = 'http://some.url/'; + } +} + class FetchResponseTest extends PHPUnit_TestCase { function setUp() { @@ -627,6 +635,23 @@ class FetchResponseTest extends PHPUnit_TestCase { { $this->assertTrue(Auth_OpenID_AX::isError($this->msg->get($this->type_a))); } + + function test_fromSuccessResponseWithoutExtension() + { + $args = array( + 'mode' => 'id_res', + 'ns' => Auth_OpenID_OPENID2_NS + ); + $sf = array(); + foreach (array_keys($args) as $k) { + array_push($sf, $k); + } + $msg = Auth_OpenID_Message::fromOpenIDArgs($args); + $e = new FauxEndpoint(); + $resp = new Auth_OpenID_SuccessResponse($e, $msg, $sf); + $ax_resp = Auth_OpenID_AX_FetchResponse::fromSuccessResponse($resp); + $this->assertTrue($ax_resp === null); + } } class StoreRequestTest extends PHPUnit_TestCase { |