You are here

function SecureSiteFormUserTest::setUp in Secure Site 8

Implements setUp().

Overrides WebTestBase::setUp

File

src/Tests/FormAuth/SecureSiteFormUserTest.php, line 43
Contains Drupal\securesite\Tests\FormAuth\SecureSiteFormUserTest

Class

SecureSiteFormUserTest
Functional tests for form authentication with user credentials.

Namespace

Drupal\securesite\Tests\FormAuth

Code

function setUp() {
  parent::setUp();
  user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array(
    'access secured pages',
  ));
  $this->normal_user = $this
    ->drupalCreateUser();
  $this->access_user = $this
    ->drupalCreateUser(array(
    'access secured pages',
  ));
  $config = \Drupal::config('securesite.settings');
  $config
    ->set('securesite_enabled', SECURESITE_ALWAYS);

  // Should work with all authentication methods enabled.
  $config
    ->set('securesite_type', array(
    SECURESITE_FORM,
    SECURESITE_BASIC,
    SECURESITE_DIGEST,
  ));
  $config
    ->save();
}