You are here

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

Setup test case, ensure that authcache module is loaded.

Overrides DrupalWebTestCase::setUp

File

tests/authcache.widget.test, line 35
Test cases for pluggable cache backends.

Class

AuthcacheTestAdminWidgets
Cover authcache module.

Code

public function setUp() {
  parent::setUp('authcache_widget_test');

  // Work around #1873606
  $this->plainUser = $this
    ->drupalCreateUser(array());
  user_save($this->plainUser, array(
    'roles' => array(
      DRUPAL_AUTHENTICATED_RID => DRUPAL_AUTHENTICATED_RID,
    ),
  ));
  $this->member = $this
    ->drupalCreateUser(array(
    'access content',
  ));
  $this->admin = $this
    ->drupalCreateUser(array(
    'administer site configuration',
  ));
  $this->authcacheRoles = array(
    DRUPAL_ANONYMOUS_RID => DRUPAL_ANONYMOUS_RID,
    DRUPAL_AUTHENTICATED_RID => DRUPAL_AUTHENTICATED_RID,
  ) + $this->plainUser->roles + $this->member->roles;

  // Setup authcache.
  variable_set('authcache_roles', $this->authcacheRoles);

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