summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2007-10-16 20:15:56 +0000
committertailor <cygnus@janrain.com>2007-10-16 20:15:56 +0000
commitc0a45e443054d8fc9e67b7c88a121c2e9f0ab68e (patch)
treea250b6276fcb700fc621f06738b36f4953744dc5 /Tests
parentb4a2eda736995f1ae9d23171fcce753cd85b786a (diff)
downloadphp-openid-c0a45e443054d8fc9e67b7c88a121c2e9f0ab68e.zip
php-openid-c0a45e443054d8fc9e67b7c88a121c2e9f0ab68e.tar.gz
php-openid-c0a45e443054d8fc9e67b7c88a121c2e9f0ab68e.tar.bz2
[project @ Add support for openid.ax.count.ALIAS="unlimited"]
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Auth/OpenID/AX.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/Tests/Auth/OpenID/AX.php b/Tests/Auth/OpenID/AX.php
index 96e7cfa..9c9c397 100644
--- a/Tests/Auth/OpenID/AX.php
+++ b/Tests/Auth/OpenID/AX.php
@@ -160,6 +160,34 @@ class ParseAXValuesTest extends PHPUnit_TestCase {
'count.foo' => '1'));
}
+ function test_invalidCountValue()
+ {
+ $msg = new Auth_OpenID_AX_FetchRequest();
+
+ $result = $msg->parseExtensionArgs(
+ array('type.foo' => 'urn:foo',
+ 'count.foo' => 'bogus'));
+
+ $this->assertTrue(Auth_OpenID_AX::isError($result));
+ }
+
+ function test_requestUnlimitedValues()
+ {
+ $msg = new Auth_OpenID_AX_FetchRequest();
+
+ $result = $msg->parseExtensionArgs(
+ array('mode' => 'fetch_request',
+ 'required' => 'foo',
+ 'type.foo' => 'urn:foo',
+ 'count.foo' => Auth_OpenID_AX_UNLIMITED_VALUES));
+
+ $attrs = $msg->iterAttrs();
+ $foo = $attrs[0];
+
+ $this->assertTrue($foo->count == Auth_OpenID_AX_UNLIMITED_VALUES);
+ $this->assertTrue($foo->wantsUnlimitedValues());
+ }
+
function test_countPresentAndIsZero()
{
$this->failUnlessAXValues(