You are here

public function PasswordPolicyAuthmapTestCase::setUp in Password Policy 7

Set up the test.

Overrides DrupalWebTestCase::setUp

File

tests/password_policy_authmap.test, line 31
Functional tests for excluding authentication modules from policies.

Class

PasswordPolicyAuthmapTestCase
Tests of basic Password Policy constraints.

Code

public function setUp() {
  parent::setUp('password_policy');

  // Create user for setting test policy.
  $this
    ->createPolicyMaker();

  // Create user authenticated by no authentication modules.
  $account = $this
    ->drupalCreateUser();
  $this->userNoAuthenticationModule = $account;

  // Create user authenticated by authentication module "auth_module_one".
  $account = $this
    ->drupalCreateUser();
  $authmaps = array(
    'authname_auth_module_one' => $account->name,
  );
  user_set_authmaps($account, $authmaps);
  $this->userAuthenticationModuleOne = $account;

  // Create user authenticated by authentication module "auth_module_two".
  $account = $this
    ->drupalCreateUser();
  $authmaps = array(
    'authname_auth_module_two' => $account->name,
  );
  user_set_authmaps($account, $authmaps);
  $this->userAuthenticationModuleTwo = $account;

  // Set policy for testing.
  $this
    ->setTestPolicy();
}