diff options
author | tailor <dag@janrain.com> | 2008-05-30 20:20:50 +0000 |
---|---|---|
committer | tailor <dag@janrain.com> | 2008-05-30 20:20:50 +0000 |
commit | 9404b62c9afe6ec9c65d1dabafa1f0d449183c61 (patch) | |
tree | 4014b280aeb0e807f9ada15a2de793de3571f7d4 /Tests/Auth | |
parent | 117fa62d44f207906608b191d7f4399dfd4c7635 (diff) | |
download | php-openid-9404b62c9afe6ec9c65d1dabafa1f0d449183c61.zip php-openid-9404b62c9afe6ec9c65d1dabafa1f0d449183c61.tar.gz php-openid-9404b62c9afe6ec9c65d1dabafa1f0d449183c61.tar.bz2 |
[project @ Remove URL fragment in ServiceEndpoint->getDisplayIdentifier]
Diffstat (limited to 'Tests/Auth')
-rw-r--r-- | Tests/Auth/OpenID/Discover_OpenID.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Tests/Auth/OpenID/Discover_OpenID.php b/Tests/Auth/OpenID/Discover_OpenID.php index ccfe61d..a00873f 100644 --- a/Tests/Auth/OpenID/Discover_OpenID.php +++ b/Tests/Auth/OpenID/Discover_OpenID.php @@ -27,6 +27,38 @@ class _SimpleMockFetcher { } } +class Tests_Auth_OpenID_ServiceEndpoint extends PHPUnit_TestCase { + function setUp() { + $this->endpoint = new Auth_OpenID_ServiceEndpoint(); + } + + function test_getDisplayIdentifier_noFragment() { + $urls = array("http://foo.bar.com/something", + "http://foo.bar.com/something?else=what¬hing=0", + "https://smoker.myopenid.com/" + ); + + foreach ($urls as $url) { + $this->endpoint->claimed_id = $url; + $this->assertEquals($url, $this->endpoint->getDisplayIdentifier()); + } + } + + function test_getDisplayIdentifier_withFragment() { + $urls = array("http://foo.bar.com/something#fragged", + "http://foo.bar.com/something?else=what¬hing=0#ow", + "https://smoker.myopenid.com/#myentirelife" + ); + + foreach ($urls as $url) { + $this->endpoint->claimed_id = $url; + $split = explode('#', $url); + $this->assertEquals($split[0], + $this->endpoint->getDisplayIdentifier()); + } + } +} + class Tests_Auth_OpenID_DiscoveryFailure extends PHPUnit_TestCase { function Tests_Auth_OpenID_DiscoveryFailure($responses) |