summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2007-04-05 22:09:54 +0000
committertailor <cygnus@janrain.com>2007-04-05 22:09:54 +0000
commit152b922337a75cac3ec1614e5e6024e54e92f887 (patch)
tree73c23d35a35ae0202ed2851d2a63bfd716f3595e
parent99457203cfe3ac08472e2b332bc25104ee5aa500 (diff)
downloadphp-openid-152b922337a75cac3ec1614e5e6024e54e92f887.zip
php-openid-152b922337a75cac3ec1614e5e6024e54e92f887.tar.gz
php-openid-152b922337a75cac3ec1614e5e6024e54e92f887.tar.bz2
[project @ Add test cases for Auth_OpenID::getQuery]
-rw-r--r--Tests/Auth/OpenID/Util.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/Tests/Auth/OpenID/Util.php b/Tests/Auth/OpenID/Util.php
index 838a5a6..de60c92 100644
--- a/Tests/Auth/OpenID/Util.php
+++ b/Tests/Auth/OpenID/Util.php
@@ -255,6 +255,34 @@ assert not should_raise and actual == expected, case
Auth_OpenID::appendArgs($url, $query));
}
}
+
+ function test_getQuery()
+ {
+ $queries = array(
+ '' => array(),
+ 'single' => array(),
+ 'no&pairs' => array(),
+ 'x%3Dy' => array(),
+ 'single&real=value' => array('real' => 'value'),
+ 'x=y&m=x%3Dn' => array('x' => 'y', 'm' => 'x=n'),
+ '&m=x%20y' => array('m' => 'x y'),
+ 'single&&m=x%20y&bogus' => array('m' => 'x y'),
+ // Even with invalid encoding. But don't do that.
+ 'too=many=equals&' => array('too' => 'many=equals')
+ );
+
+ foreach ($queries as $s => $data) {
+ $query = Auth_OpenID::getQuery($s);
+
+ foreach ($data as $key => $value) {
+ $this->assertTrue($query[$key] === $value);
+ }
+
+ foreach ($query as $key => $value) {
+ $this->assertTrue($data[$key] === $value);
+ }
+ }
+ }
}
?>