You are here

public function AutoLogoutByRoleTestCase::setUp in Automated Logout 7.4

setUp() performs any pre-requisite tasks that need to happen.

Overrides DrupalWebTestCase::setUp

File

tests/autologout.test, line 623
Simpletest tests for autologout.

Class

AutoLogoutByRoleTestCase
Tests the autologout's features.

Code

public function setUp() {

  // Enable any modules required for the test.
  parent::setUp('autologout');

  // Create and log in our privileged user.
  $this->user = $this
    ->drupalCreateUser(array(
    'access content',
  ));
  $this->role = (object) array(
    'name' => 'test user role',
  );
  user_role_save($this->role);
  $this->user->roles[$this->role->rid] = $this->role->name;
  user_save($this->user);
  $this
    ->drupalLogin($this->user);

  // Set the timeout period to 5 seconds.
  variable_set('autologout_padding', 5);
}