You are here

protected function BmTestBase::loginUser1 in Backup and Migrate 7.3

Log in as user 1.

The benefit of doing this is that it ignores permissions entirely, so the raw functionality can be tested.

5 calls to BmTestBase::loginUser1()
BmTestBasics::setUp in tests/BmTestBasics.test
Sets up a Drupal site for running functional and integration tests.
BmTestCtools::setUp in tests/BmTestCtools.test
Sets up a Drupal site for running functional and integration tests.
BmTestEmail::setUp in tests/BmTestEmail.test
Sets up a Drupal site for running functional and integration tests.
BmTestProfiles::setUp in tests/BmTestProfiles.test
Sets up a Drupal site for running functional and integration tests.
BmTestUpdate7310::setUp in tests/BmTestUpdate7310.test
Sets up a Drupal site for running functional and integration tests.

File

tests/BmTestBase.test, line 27
Shared functionality to make the rest of the tests simpler.

Class

BmTestBase
Base class for testing a module's custom tags.

Code

protected function loginUser1() {

  // Load user 1.
  $account = user_load(1, TRUE);

  // Reset the password.
  $password = user_password();
  $edit = array(
    'pass' => $password,
  );
  user_save($account, $edit);
  $account->pass_raw = $password;

  // Login.
  $this
    ->drupalLogin($account);
}