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

8.0.x
Dries 2012-04-29 12:19:35 -04:00
parent 02750689dd
commit 9dd0e7bebf
3 changed files with 8 additions and 7 deletions

View File

@ -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;

View File

@ -1266,8 +1266,8 @@ class DrupalWebTestCase extends DrupalTestCase {
// 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'));

View File

@ -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'.