diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-05-13 17:23:48 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-05-13 17:23:48 +0000 |
commit | 679e9011d97e5c79c308aad23ffc240f0ba69737 (patch) | |
tree | 36c108252c5e798574caeee3cd3c2ea7f523c700 /modules | |
parent | 09787420897868e203410efe4323106a47a40c15 (diff) | |
download | brdo-679e9011d97e5c79c308aad23ffc240f0ba69737.tar.gz brdo-679e9011d97e5c79c308aad23ffc240f0ba69737.tar.bz2 |
#292565 follow-up by Jody Lynn: Remove ['destination'] hacks to get login redirection working again.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/user/user.test | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/user/user.test b/modules/user/user.test index 3822cc537..b9e0f5ba9 100644 --- a/modules/user/user.test +++ b/modules/user/user.test @@ -923,6 +923,30 @@ class UserBlocksUnitTests extends DrupalWebTestCase { } /** + * Test the user login block. + */ + function testUserLoginBlock() { + // Create a user with some permission that anonymous users lack. + $user = $this->drupalCreateUser(array('administer permissions')); + + // Log in using the block. + $edit = array(); + $edit['name'] = $user->name; + $edit['pass'] = $user->pass_raw; + $this->drupalPost('admin/user/permissions', $edit, t('Log in')); + $this->assertText(t('Log out'), t('Logged in.')); + + // Check that we are still on the same page. + $this->assertPattern('!<title.*?' . t('Permissions') . '.*?</title>!', t('Still on the same page after login for access denied page')); + + // Now, log out and repeat with a non-403 page. + $this->clickLink(t('Log out')); + $this->drupalPost('filter/tips', $edit, t('Log in')); + $this->assertText(t('Log out'), t('Logged in.')); + $this->assertPattern('!<title.*?' . t('Compose tips') . '.*?</title>!', t('Still on the same page after login for allowed page')); + } + + /** * Test the Who's Online block. */ function testWhosOnlineBlock() { |