public function AuthcacheAuthenticatedKeysTestCase::testHookAuthcacheKeyProperties in Authenticated User Page Caching (Authcache) 7.2
Test custom key properties.
Verify that custom properties provided via hook_authcache_key_properties are considered.
File
- ./
authcache.test, line 1581 - Tests for system.module.
Class
- AuthcacheAuthenticatedKeysTestCase
- Test key computation and handling.
Code
public function testHookAuthcacheKeyProperties() {
$this
->setupConfig();
$this
->resetTestVariables();
$this
->drupalLogin($this->plainUser);
$original_key = $this
->drupalGet('authcache-test-get-key');
$this
->drupalLogout();
$propname = $this
->randomName(4);
$propvalue = $this
->randomName(8);
variable_set('authcache_test_authcache_key_properties', array(
$propname => $propvalue,
));
$this
->drupalLogin($this->plainUser);
$new_key = $this
->drupalGet('authcache-test-get-key');
$this
->drupalLogout();
$this
->assertNotEqual($original_key, $new_key);
}