function OpenIDFunctionalTestCase::testBlockedUserLogin

Test that a blocked user cannot log in.

Archivo

drupal-7.x/modules/openid/openid.test, line 248
Tests for openid.module.

Class

OpenIDFunctionalTestCase
Test discovery and login using OpenID

Código

function testBlockedUserLogin() {
  // Use a User-supplied Identity that is the URL of an XRDS document.
  $identity = url('openid-test/yadis/xrds', array('absolute' => TRUE));

  // Log in and add an OpenID Identity to the account.
  $this->drupalLogin($this->web_user);
  $this->addIdentity($identity);
  $this->drupalLogout();

  // Log in as an admin user and block the account.
  $admin_user = $this->drupalCreateUser(array('administer users'));
  $this->drupalLogin($admin_user);
  $this->drupalGet('admin/people');
  $edit = array(
    'operation' => 'block',
    'accounts[' . $this->web_user->uid . ']' => TRUE,
  );
  $this->drupalPost('admin/people', $edit, t('Update'));
  $this->assertRaw('The update has been performed.', 'Account was blocked.');
  $this->drupalLogout();

  $this->submitLoginForm($identity);
  $this->assertRaw(t('The username %name has not been activated or is blocked.', array('%name' => $this->web_user->name)), 'User login was blocked.');
}