You are here

function SecureSiteBasicGuestUnsetTest::testSecureSiteTypeBasicGuestUnsetRandomNoAccess in Secure Site 8

Request home page with random credentials and access disabled.

File

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

Class

SecureSiteBasicGuestUnsetTest
Functional tests for basic authentication with guest credentials unset.

Namespace

Drupal\securesite\Tests\BasicAuth

Code

function testSecureSiteTypeBasicGuestUnsetRandomNoAccess() {
  user_role_revoke_permissions(DRUPAL_ANONYMOUS_RID, array(
    'access secured pages',
  ));
  $this->curl_options[CURLOPT_USERPWD] = $this
    ->randomName() . ':' . user_password();
  $this
    ->drupalGet(NULL);
  $this
    ->assertResponse(401, t('Requesting home page with random credentials and guest access disabled.'));
}