You are here

function SecureSiteBasicGuestUnsetTest::testSecureSiteTypeBasicGuestUnsetEmptyNoAccess in Secure Site 8

Request home page with empty credentials and access disabled.

File

src/Tests/BasicAuth/SecureSiteBasicGuestUnsetTest.php, line 50
Contains Drupal\securesite\Tests\BasicAuth\SecureSiteBasicGuestUnsetTest

Class

SecureSiteBasicGuestUnsetTest
Functional tests for basic authentication with guest credentials unset.

Namespace

Drupal\securesite\Tests\BasicAuth

Code

function testSecureSiteTypeBasicGuestUnsetEmptyNoAccess() {
  user_role_revoke_permissions(DRUPAL_ANONYMOUS_RID, array(
    'access secured pages',
  ));
  $this
    ->drupalGet(NULL);
  $this
    ->assertResponse(403, t('Requesting home page with empty credentials and guest access disabled.'));
  $this
    ->drupalHead(NULL);
  $this
    ->assertResponse(401, t('Trying to clear credentials by repeating request.'));
}