You are here

public function SecureSiteTypeBasicUserFunctionalTest::testSecureSiteTypeBasicUserNoAccess in Secure Site 7.2

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

Request home page with correct password and access disabled.

File

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

Class

SecureSiteTypeBasicUserFunctionalTest
Functional tests for basic authentication with user credentials.

Code

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