Commit 9dd0e7be authored by Dries's avatar Dries
Browse files

- Patch #1545930 by c960657: DrupalLogout() should only do one request, not two.

parent 02750689
......@@ -508,7 +508,9 @@ class CommentInterfaceTest extends CommentHelperCase {
// Adjust the current/viewing user.
switch ($case['user']) {
case 'anonymous':
$this->drupalLogout();
if ($this->loggedInUser) {
$this->drupalLogout();
}
$case['user_uid'] = 0;
break;
......
......@@ -1266,8 +1266,8 @@ protected function drupalLogout() {
// Make a request to the logout page, and redirect to the user page, the
// idea being if you were properly logged out you should be seeing a login
// screen.
$this->drupalGet('user/logout');
$this->drupalGet('user');
$this->drupalGet('user/logout', array('query' => array('destination' => 'user')));
$this->assertResponse(200, t('User was logged out.'));
$pass = $this->assertField('name', t('Username field found.'), t('Logout'));
$pass = $pass && $this->assertField('pass', t('Password field found.'), t('Logout'));
......
......@@ -245,11 +245,10 @@ class MenuRouterTestCase extends DrupalWebTestCase {
variable_set('maintenance_mode', TRUE);
$offline_message = t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => variable_get('site_name', 'Drupal')));
$this->drupalLogout();
$this->drupalGet('node');
$this->assertText($offline_message);
$this->drupalGet('menu_login_callback');
$this->assertText('This is menu_login_callback().', t('Maintenance mode can be bypassed through hook_login_paths().'));
$this->assertText('This is menu_login_callback().', t('Maintenance mode can be bypassed through hook_menu_site_status_alter().'));
}
/**
......@@ -257,8 +256,8 @@ class MenuRouterTestCase extends DrupalWebTestCase {
* 'user' and 'user/register' gets redirected to the user edit page.
*/
function testAuthUserUserLogin() {
$this->loggedInUser = $this->drupalCreateUser(array());
$this->drupalLogin($this->loggedInUser);
$web_user = $this->drupalCreateUser(array());
$this->drupalLogin($web_user);
$this->drupalGet('user/login');
// Check that we got to 'user'.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment