summaryrefslogtreecommitdiffstats
path: root/Tests/Auth
diff options
context:
space:
mode:
authortailor <chowells@janrain.com>2008-06-04 22:13:10 +0000
committertailor <chowells@janrain.com>2008-06-04 22:13:10 +0000
commit894fd661d3d1a760cffa719f081f74317388f6e8 (patch)
tree9fd50611ecc1bcb94f392642c53c1f90a1e47f5c /Tests/Auth
parent628e0bcda99f997a1ffe2b1f983a705efcbdadca (diff)
downloadphp-openid-894fd661d3d1a760cffa719f081f74317388f6e8.zip
php-openid-894fd661d3d1a760cffa719f081f74317388f6e8.tar.gz
php-openid-894fd661d3d1a760cffa719f081f74317388f6e8.tar.bz2
[project @ Fix trust root test runner and then all failing tests that were exposed]
Diffstat (limited to 'Tests/Auth')
-rw-r--r--Tests/Auth/OpenID/Parse.php2
-rw-r--r--Tests/Auth/OpenID/TrustRoot.php18
-rw-r--r--Tests/Auth/OpenID/data/trustroot.txt12
3 files changed, 20 insertions, 12 deletions
diff --git a/Tests/Auth/OpenID/Parse.php b/Tests/Auth/OpenID/Parse.php
index 7acca99..9a3547c 100644
--- a/Tests/Auth/OpenID/Parse.php
+++ b/Tests/Auth/OpenID/Parse.php
@@ -183,4 +183,4 @@ class Tests_Auth_OpenID_Parse extends PHPUnit_TestSuite {
}
}
-?> \ No newline at end of file
+?>
diff --git a/Tests/Auth/OpenID/TrustRoot.php b/Tests/Auth/OpenID/TrustRoot.php
index 95d3dec..9c7c40e 100644
--- a/Tests/Auth/OpenID/TrustRoot.php
+++ b/Tests/Auth/OpenID/TrustRoot.php
@@ -22,16 +22,16 @@ class Tests_Auth_OpenID_TRParseCase extends PHPUnit_TestCase {
$parsed = (bool)Auth_OpenID_TrustRoot::_parse($this->case);
switch ($this->expected) {
case 'sane':
- $this->assertTrue($is_sane);
- $this->assertTrue($parsed);
+ $this->assertTrue($parsed, "Did not parse");
+ $this->assertTrue($is_sane, "Is not sane");
break;
case 'insane':
- $this->assertTrue($parsed);
- $this->assertFalse($is_sane);
+ $this->assertTrue($parsed, "Did not parse");
+ $this->assertFalse($is_sane, "Is sane");
break;
default:
- $this->assertFalse($parsed);
- $this->assertFalse($is_sane);
+ $this->assertFalse($parsed, "Did parse");
+ $this->assertFalse($is_sane, "Is sane");
}
}
}
@@ -161,9 +161,13 @@ class Tests_Auth_OpenID_TrustRoot extends PHPUnit_TestSuite {
$this->setName($name);
foreach (Tests_Auth_OpenID_trustRootTests() as $test) {
- $this->addTest($test);
+ $this->_addTestByValue($test);
}
}
+
+ function _addTestByValue($test) {
+ $this->addTest($test);
+ }
}
?>
diff --git a/Tests/Auth/OpenID/data/trustroot.txt b/Tests/Auth/OpenID/data/trustroot.txt
index f6414bf..8194409 100644
--- a/Tests/Auth/OpenID/data/trustroot.txt
+++ b/Tests/Auth/OpenID/data/trustroot.txt
@@ -3,7 +3,7 @@ Trust root parsing checking
========================================
----------------------------------------
-15: Does not parse
+18: Does not parse
----------------------------------------
baz.org
*.foo.com
@@ -15,16 +15,18 @@ foo.*.com
http://foo.*.com
http://www.*
http://*foo.com/
+http://foo.com\/
+http://localhost:1900foo/
http://foo.com/invalid#fragment
5
+http:///
----------------------------------------
-16: Insane
+15: Insane
----------------------------------------
-http:///
http://*/
https://*/
http://*.com
@@ -68,7 +70,7 @@ return_to matching
========================================
----------------------------------------
-42: matches
+44: matches
----------------------------------------
http://*/ http://cnn.com/
http://*/ http://livejournal.com/
@@ -89,6 +91,8 @@ http://*.b.foo.com http://w.x.b.foo.com
http://*.bar.co.uk http://www.bar.co.uk
http://*.uoregon.edu http://x.cs.uoregon.edu
http://x.com/abc http://x.com/abc
+http://127.1/abc http://127.1/abc
+http://10.0.0.1/abc http://10.0.0.1/abc
http://x.com/abc http://x.com/abc/def
http://*.x.com http://x.com/gallery
http://*.x.com http://foo.x.com/gallery