You are here

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

Initialize test case.

Overrides DrupalWebTestCase::setUp

File

modules/authcache_builtin/tests/authcache_builtin.cache-backend.test, line 30
Test cases for the Authcache Bultin Cache Backend module.

Class

AuthcacheBuiltinTestCacheBackend
Tests update functionality unrelated to the database.

Code

public function setUp() {
  global $base_url;
  parent::setUp('authcache_builtin', 'authcache_builtin_test');
  $this->fcURL = $base_url . '/' . drupal_get_path('module', 'authcache_builtin') . '/tests/frontcontroller/index.php';
  $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);

  // HookStub.
  $this->stubmod = new ModuleStub('authcache_builtin_test');
}