You are here

function SecureSiteBasicGuestSetTest::testSecureSiteTypeBasicGuestSetEmpty in Secure Site 8

Request home page with empty credentials.

File

src/Tests/BasicAuth/SecureSiteBasicGuestSetTest.php, line 61
Contains Drupal\securesite\Tests\BasicAuth\SecureSiteBasicGuestSetTest

Class

SecureSiteBasicGuestSetTest
Functional tests for basic authentication with guest credentials set.

Namespace

Drupal\securesite\Tests\BasicAuth

Code

function testSecureSiteTypeBasicGuestSetEmpty() {

  //todo curl options
  $this->curl_options[CURLOPT_USERPWD] = ':';
  $this
    ->drupalHead(NULL);
  $this
    ->assertResponse(403, t('Requesting home page with empty credentials.'));
  $this
    ->drupalHead(NULL);
  $this
    ->assertResponse(401, t('Trying to clear credentials by repeating request.'));
}