You are here

function SecureSiteTypeDigestUserUnstoredFunctionalTest::testSecureSiteTypeDigestUserUnstoredBasic in Secure Site 6.2

Same name and namespace in other branches
  1. 7.2 securesite.test \SecureSiteTypeDigestUserUnstoredFunctionalTest::testSecureSiteTypeDigestUserUnstoredBasic()

Request home page with basic fall-back.

File

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

Class

SecureSiteTypeDigestUserUnstoredFunctionalTest
Functional tests for digest authentication with user credentials.

Code

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