You are here

function SecureSiteBasicNoneTest::testSecureSiteTypeBasicNone in Secure Site 8

Request home page without credentials.

File

src/Tests/BasicAuth/SecureSiteBasicNoneTest.php, line 44
Contains Drupal\securesite\Tests\BasicAuth\SecureSiteBasicNoneTest

Class

SecureSiteBasicNoneTest
Functional test for basic authentication without credentials.

Namespace

Drupal\securesite\Tests\BasicAuth

Code

function testSecureSiteTypeBasicNone() {
  $this
    ->drupalHead(NULL);
  $this
    ->assertResponse(401, t('Requesting home page.'));
  $found_scheme = FALSE;
  if (stripos($this
    ->drupalGetHeader('WWW-Authenticate'), 'Basic') === 0) {
    $found_scheme = TRUE;
  }
  $this
    ->assertTrue($found_scheme, t('Checking for basic authentication scheme.'));
}