You are here

protected function AuthcacheWebTestCase::authcacheSetUser in Authenticated User Page Caching (Authcache) 7.2

Utility method, make sure the specified user is logged in.

2 calls to AuthcacheWebTestCase::authcacheSetUser()
AuthcacheWebTestCase::authcacheGet in ./authcache.test
Utility method, login with specified account, send get-request, logout.
AuthcacheWebTestCase::authcachePost in ./authcache.test
Utility method, login with specified account, send post-request, logout.

File

./authcache.test, line 131
Tests for system.module.

Class

AuthcacheWebTestCase
Helper class for module test cases.

Code

protected function authcacheSetUser($account) {
  if ($account->uid && $account != $this->loggedInUser) {
    $this
      ->drupalLogin($account);
  }
  elseif (!$account->uid && $this->loggedInUser) {
    $this
      ->drupalLogout();
  }
}