? .buildpath ? .cache ? .project ? .settings ? web.config ? sites/all/modules/contrib ? sites/all/modules/own ? sites/default/files ? sites/default/private ? sites/default/settings.php Index: modules/openid/openid.test =================================================================== RCS file: /cvs/drupal/drupal/modules/openid/openid.test,v retrieving revision 1.5 diff -u -p -r1.5 openid.test --- modules/openid/openid.test 15 Sep 2009 19:46:04 -0000 1.5 +++ modules/openid/openid.test 15 Sep 2009 18:30:52 -0000 @@ -249,4 +249,24 @@ class OpenIDUnitTest extends DrupalWebTe $this->assertFalse(_openid_is_xri('user@example.com/'), t('_openid_is_xri returned expected result for an http URL.')); $this->assertFalse(_openid_is_xri('http://user@example.com/'), t('_openid_is_xri returned expected result for an http URL.')); } + + /** + * Test _openid_normalize(). + */ + function testOpenidNormalize() { + // Test that the normalization is according to OpenID Authentication 2.0, + // section 7.2 and 11.5.2. + + $this->assertEqual(_openid_normalize('$foo'), '$foo', t('_openid_normalize correctly normalized an XRI.')); + $this->assertEqual(_openid_normalize('xri://$foo'), '$foo', t('_openid_normalize correctly normalized an XRI with an xri:// scheme.')); + + $this->assertEqual(_openid_normalize('example.com/'), 'http://example.com/', t('_openid_normalize correctly normalized a URL with a missing scheme.')); + $this->assertEqual(_openid_normalize('example.com'), 'http://example.com/', t('_openid_normalize correctly normalized a URL with a missing scheme and empty path.')); + $this->assertEqual(_openid_normalize('http://example.com'), 'http://example.com/', t('_openid_normalize correctly normalized a URL with an empty path.')); + + $this->assertEqual(_openid_normalize('http://example.com/path'), 'http://example.com/path', t('_openid_normalize correctly normalized a URL with a path')); + + $this->assertEqual(_openid_normalize('http://example.com/path#fragment'), 'http://example.com/path', t('_openid_normalize correctly normalized a URL with a fragment')); + } + }