From 679e9011d97e5c79c308aad23ffc240f0ba69737 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Wed, 13 May 2009 17:23:48 +0000 Subject: #292565 follow-up by Jody Lynn: Remove ['destination'] hacks to get login redirection working again. --- modules/user/user.test | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'modules/user/user.test') 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 @@ -922,6 +922,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('!!', 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('!!', t('Still on the same page after login for allowed page')); + } + /** * Test the Who's Online block. */ -- cgit v1.2.3