You are here

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

Overrides DrupalWebTestCase::setUp().

Configures basic Ubercart store components.

Parameters

$modules: Optional list of extra modules to install.

$permissions: Optional list of extra permissions for $this->adminUser.

Overrides UbercartTestHelper::setUp

File

modules/authcache_ubercart/authcache_ubercart.test, line 32
Test cases for the Authcache Ubercart module.

Class

AuthcacheUbercartTest
Tests for markup substitution.

Code

public function setUp($modules = array(), $permissions = array()) {
  $modules = array_merge(array(
    'authcache_ubercart',
    'authcache_form',
    'authcache_p13n',
    'authcache_p13n_test',
    'cacheobject',
  ), $modules);
  parent::setUp($modules, $permissions);
  variable_set('cache_class_cache_form', 'CacheObjectAPIWrapper');
  variable_set('cacheobject_class_cache_form', 'DrupalDatabaseCache');
  module_disable(array(
    'comment',
  ));
  $this
    ->resetAll();
  $authcache_roles = array(
    DRUPAL_ANONYMOUS_RID => DRUPAL_ANONYMOUS_RID,
    DRUPAL_AUTHENTICATED_RID => DRUPAL_AUTHENTICATED_RID,
  ) + $this->customer->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_p13n_test');
}