You are here

public function SecureSiteTypeBasicNoneFunctionalTest::testSecureSiteTypeBasicNone in Secure Site 7.2

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

Request home page without credentials.

File

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

Class

SecureSiteTypeBasicNoneFunctionalTest
Functional test for basic authentication without credentials.

Code

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