diff options
author | tailor <cygnus@janrain.com> | 2007-10-01 21:40:46 +0000 |
---|---|---|
committer | tailor <cygnus@janrain.com> | 2007-10-01 21:40:46 +0000 |
commit | 98ad3633c4cd059d9a3d3832c2e63c2a1e1b87db (patch) | |
tree | 2c88e86904c638c448ac3caf44c26f194cffea05 /Tests | |
parent | f809201a6b3648cc2e5f66619115710f604a38ef (diff) | |
download | php-openid-98ad3633c4cd059d9a3d3832c2e63c2a1e1b87db.zip php-openid-98ad3633c4cd059d9a3d3832c2e63c2a1e1b87db.tar.gz php-openid-98ad3633c4cd059d9a3d3832c2e63c2a1e1b87db.tar.bz2 |
[project @ Remove fragments as part of normalization]
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/Auth/OpenID/Discover_OpenID.php | 27 | ||||
-rw-r--r-- | Tests/Auth/OpenID/data/openid.html | 11 |
2 files changed, 38 insertions, 0 deletions
diff --git a/Tests/Auth/OpenID/Discover_OpenID.php b/Tests/Auth/OpenID/Discover_OpenID.php index 250a29e..369f77b 100644 --- a/Tests/Auth/OpenID/Discover_OpenID.php +++ b/Tests/Auth/OpenID/Discover_OpenID.php @@ -279,6 +279,33 @@ class Tests_Auth_OpenID_Discover_OpenID extends _DiscoveryBase { false); } + /* + * Ensure that the Claimed Identifier does not have a fragment if + * one is supplied in the User Input. + */ + function test_html1Fragment() + { + $data = Tests_Auth_OpenID_readdata('openid.html'); + $content_type = 'text/html'; + $expected_services = 1; + + $this->fetcher->documents[$this->id_url] = array($content_type, $data); + $expected_id = $this->id_url; + $this->id_url = $this->id_url . '#fragment'; + list($id_url, $services) = Auth_OpenID_discover($this->id_url, $this->fetcher); + $this->assertEquals($expected_services, count($services)); + $this->assertEquals($expected_id, $id_url); + + $this->_checkService( + $services[0], + "http://www.myopenid.com/server", + $expected_id, + 'http://smoker.myopenid.com/', + null, + array('1.1'), + false); + } + function test_html2() { $services = $this->_discover('text/html', diff --git a/Tests/Auth/OpenID/data/openid.html b/Tests/Auth/OpenID/data/openid.html new file mode 100644 index 0000000..1a57d44 --- /dev/null +++ b/Tests/Auth/OpenID/data/openid.html @@ -0,0 +1,11 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html> + <head> + <title>Identity Page for Smoker</title> + <link rel="openid.server" href="http://www.myopenid.com/server" /> + <link rel="openid.delegate" href="http://smoker.myopenid.com/" /> + </head> + <body> + <p>foo</p> + </body> +</html> |