You are here

public function AuthcacheTestBackend::setUp in Authenticated User Page Caching (Authcache) 7.2

Setup test case, ensure that authcache module is loaded.

Overrides DrupalWebTestCase::setUp

File

tests/authcache.backend.test, line 34
Test cases for pluggable cache backends.

Class

AuthcacheTestBackend
Cover authcache module.

Code

public function setUp() {
  parent::setUp('authcache_backend_test');
  $this->member = $this
    ->drupalCreateUser(array());
  $authcache_roles = array(
    DRUPAL_ANONYMOUS_RID => DRUPAL_ANONYMOUS_RID,
    DRUPAL_AUTHENTICATED_RID => DRUPAL_AUTHENTICATED_RID,
  ) + $this->member->roles;

  // Setup authcache.
  variable_set('authcache_roles', $authcache_roles);
  $pagecaching = _authcache_default_pagecaching();
  $pagecaching[0]['roles']['roles'] = $authcache_roles;
  variable_set('authcache_pagecaching', $pagecaching);

  // Set max-age default value.
  variable_set('page_cache_maximum_age', 3600);

  // HookStub.
  $this->stubbackend = new ModuleStub('authcache_backend_test');
}