diff options
Diffstat (limited to 'modules/openid/openid.test')
-rw-r--r-- | modules/openid/openid.test | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/modules/openid/openid.test b/modules/openid/openid.test index 3e58c1f6d..49f390b12 100644 --- a/modules/openid/openid.test +++ b/modules/openid/openid.test @@ -67,7 +67,10 @@ class OpenIDFunctionalTestCase extends OpenIDWebTestCase { // The URL scheme is stripped in order to test that the supplied identifier // is normalized in openid_begin(). $identity = url('openid-test/yadis/xrds', array('absolute' => TRUE)); - $this->addIdentity(preg_replace('@^https?://@', '', $identity), 2, $identity); + $this->addIdentity(preg_replace('@^https?://@', '', $identity), 2, 'http://example.com/xrds', $identity); + + $identity = url('openid-test/yadis/xrds/delegate', array('absolute' => TRUE)); + $this->addIdentity(preg_replace('@^https?://@', '', $identity), 2, 'http://example.com/xrds-delegate', $identity); // Identifier is the URL of an XRDS document containing an OP Identifier // Element. The Relying Party sends the special value @@ -78,7 +81,7 @@ class OpenIDFunctionalTestCase extends OpenIDWebTestCase { // is stripped in order to test that the returned identifier is normalized in // openid_complete(). variable_set('openid_test_response', array('openid.claimed_id' => preg_replace('@^https?://@', '', $identity))); - $this->addIdentity(url('openid-test/yadis/xrds/server', array('absolute' => TRUE)), 2, $identity); + $this->addIdentity(url('openid-test/yadis/xrds/server', array('absolute' => TRUE)), 2, 'http://specs.openid.net/auth/2.0/identifier_select', $identity); variable_set('openid_test_response', array()); // Identifier is the URL of an HTML page that is sent with an HTTP header @@ -91,11 +94,11 @@ class OpenIDFunctionalTestCase extends OpenIDWebTestCase { // Identifier is an XRI. Resolve using our own dummy proxy resolver. variable_set('xri_proxy_resolver', url('openid-test/yadis/xrds/xri', array('absolute' => TRUE)) . '/'); - $this->addIdentity('@example*résumé;%25', 2, 'http://example.com/user'); + $this->addIdentity('@example*résumé;%25', 2, 'http://example.com/xrds', 'http://example.com/user'); // Make sure that unverified CanonicalID are not trusted. variable_set('openid_test_canonical_id_status', 'bad value'); - $this->addIdentity('@example*résumé;%25', 2, FALSE); + $this->addIdentity('@example*résumé;%25', 2, FALSE, FALSE); // HTML-based discovery: // If the User-supplied Identifier is a URL of an HTML page, the page may @@ -103,10 +106,10 @@ class OpenIDFunctionalTestCase extends OpenIDWebTestCase { // Provider Endpoint. OpenID 1 and 2 describe slightly different formats. // OpenID Authentication 1.1, section 3.1: - $this->addIdentity(url('openid-test/html/openid1', array('absolute' => TRUE)), 1); + $this->addIdentity(url('openid-test/html/openid1', array('absolute' => TRUE)), 1, 'http://example.com/html-openid1'); // OpenID Authentication 2.0, section 7.3.3: - $this->addIdentity(url('openid-test/html/openid2', array('absolute' => TRUE)), 2); + $this->addIdentity(url('openid-test/html/openid2', array('absolute' => TRUE)), 2, 'http://example.com/html-openid2'); } /** @@ -197,11 +200,16 @@ class OpenIDFunctionalTestCase extends OpenIDWebTestCase { * The User-supplied Identifier. * @param $version * The protocol version used by the service. + * @param $local_id + * The expected OP-Local Identifier found during discovery. * @param $claimed_id * The expected Claimed Identifier returned by the OpenID Provider, or FALSE * if the discovery is expected to fail. */ - function addIdentity($identity, $version = 2, $claimed_id = NULL) { + function addIdentity($identity, $version = 2, $local_id = 'http://example.com/xrds', $claimed_id = NULL) { + // Tell openid_test.module to only accept this OP-Local Identifier. + variable_set('openid_test_identity', $local_id); + $edit = array('openid_identifier' => $identity); $this->drupalPost('user/' . $this->web_user->uid . '/openid', $edit, t('Add an OpenID')); |