diff options
Diffstat (limited to 'modules/openid/openid.test')
-rw-r--r-- | modules/openid/openid.test | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/modules/openid/openid.test b/modules/openid/openid.test index cf90161fd..68313ae7e 100644 --- a/modules/openid/openid.test +++ b/modules/openid/openid.test @@ -147,6 +147,38 @@ class OpenIDFunctionalTestCase extends OpenIDWebTestCase { } /** + * Test login using OpenID during maintenance mode. + */ + function testLoginMaintenanceMode() { + $this->web_user = $this->drupalCreateUser(array('access site in maintenance mode')); + $this->drupalLogin($this->web_user); + + // Use a User-supplied Identity that is the URL of an XRDS document. + $identity = url('openid-test/yadis/xrds', array('absolute' => TRUE)); + $this->addIdentity($identity); + $this->drupalLogout(); + + // Enable maintenance mode. + variable_set('maintenance_mode', 1); + + // Test logging in via the user/login page while the site is offline. + $edit = array('openid_identifier' => $identity); + $this->drupalPost('user/login', $edit, t('Log in')); + + // Check we are on the OpenID redirect form. + $this->assertTitle(t('OpenID redirect'), t('OpenID redirect page was displayed.')); + + // Submit form to the OpenID Provider Endpoint. + $this->drupalPost(NULL, array(), t('Send')); + + $this->assertLink($this->web_user->name, 0, t('User was logged in.')); + + // Verify user was redirected away from user/login to an accessible page. + $this->assertText(t('Operating in maintenance mode.')); + $this->assertResponse(200); + } + + /** * Test deleting an OpenID identity from a user's profile. */ function testDelete() { |