You are here

function SecureSiteTypeBasicGuestSetFunctionalTest::setUp in Secure Site 6.2

Same name and namespace in other branches
  1. 7.2 securesite.test \SecureSiteTypeBasicGuestSetFunctionalTest::setUp()

Implementation of setUp().

Overrides DrupalWebTestCase::setUp

File

./securesite.test, line 1407
Tests for Secure Site module.

Class

SecureSiteTypeBasicGuestSetFunctionalTest
Functional tests for basic authentication with guest credentials set.

Code

function setUp() {
  parent::setUp('securesite');
  $perm = db_result(db_query("SELECT perm FROM {permission} WHERE rid = %d", DRUPAL_ANONYMOUS_RID));
  db_query("UPDATE {permission} SET perm = '%s' WHERE rid = %d", $perm . ', access secured pages', DRUPAL_ANONYMOUS_RID);
  $this->name = $this
    ->randomName();
  $this->pass = user_password();
  variable_set('securesite_guest_name', $this->name);
  variable_set('securesite_guest_pass', $this->pass);

  // Should work with all authentication methods enabled.
  variable_set('securesite_type', array(
    SECURESITE_FORM,
    SECURESITE_BASIC,
    SECURESITE_DIGEST,
  ));
}