You are here

function SecureSiteBasicUserTest::testSecureSiteTypeBasicUserNoAccess in Secure Site 8

Request home page with correct password and access disabled.

File

src/Tests/BasicAuth/SecureSiteBasicUserTest.php, line 63
Contains Drupal\securesite\Tests\BasicAuth\SecureSiteBasicUserTest

Class

SecureSiteBasicUserTest
Functional tests for basic authentication with user credentials.

Namespace

Drupal\securesite\Tests\BasicAuth

Code

function testSecureSiteTypeBasicUserNoAccess() {
  $this->curl_options[CURLOPT_USERPWD] = $this->normal_user->name . ':' . $this->normal_user->pass_raw;
  $this
    ->drupalGet(NULL);
  $this
    ->assertResponse(403, t('Requesting home page with correct password and access disabled.'));
  $this
    ->drupalHead(NULL);
  $this
    ->assertResponse(401, t('Trying to clear credentials by repeating request.'));
}