You are here

public function SecureSiteTypeBasicGuestUnsetFunctionalTest::testSecureSiteTypeBasicGuestUnsetRandomNoAccess in Secure Site 7.2

Same name and namespace in other branches
  1. 6.2 securesite.test \SecureSiteTypeBasicGuestUnsetFunctionalTest::testSecureSiteTypeBasicGuestUnsetRandomNoAccess()

Request home page with random credentials and access disabled.

File

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

Class

SecureSiteTypeBasicGuestUnsetFunctionalTest
Functional tests for basic authentication with guest credentials unset.

Code

public 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.'));
}