You are here

public function AuthcacheAuthenticatedKeysTestCase::testUniqSuperuserKey in Authenticated User Page Caching (Authcache) 7.2

Verify that superuser key is unique.

File

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

Class

AuthcacheAuthenticatedKeysTestCase
Test key computation and handling.

Code

public function testUniqSuperuserKey() {
  $this
    ->setupConfig();
  $this
    ->resetTestVariables();
  $this
    ->drupalLogin($this->superUser);
  $superuser_key = $this
    ->drupalGet('authcache-test-get-key');
  $this
    ->drupalLogout();
  $new_account = $this
    ->drupalCreateUser();
  user_save($new_account, array(
    'roles' => $this->superUser->roles,
  ));
  $this
    ->drupalLogin($new_account);
  $new_account_key = $this
    ->drupalGet('authcache-test-get-key');
  $this
    ->drupalLogout();
  $this
    ->assertNotEqual($superuser_key, $new_account_key);
}