You are here

public function MaillogTestCase::createAdminUser in Maillog / Mail Developer 7

Create an admin account.

1 call to MaillogTestCase::createAdminUser()
MaillogTestCase::loginAdminUser in tests/MaillogTestCase.test
Log into the site as an admin user.

File

tests/MaillogTestCase.test, line 313
Unit-ish tests for the Maillog module.

Class

MaillogTestCase
All unit tests for the module.

Code

public function createAdminUser() {
  $permissions = array(
    'administer maillog',
    'view maillog',
    'delete maillog',
    // General admin access.
    'access administration pages',
  );

  // Reset the static variable used to identify permissions, otherwise it's
  // possible the permissions check in drupalCreateUser will fail.
  $this
    ->checkPermissions(array(), TRUE);
  cache_clear_all();
  return $this
    ->drupalCreateUser($permissions);
}