You are here

function SecureSiteTest::testLoginAnonymousHTTP in Secure Site 5

Same name and namespace in other branches
  1. 6 tests/securesite.test \SecureSiteTest::testLoginAnonymousHTTP()

Check that anonymous users get the correct headers when using HTTP Auth

File

tests/securesite.test, line 68
Secure Site module unit tests

Class

SecureSiteTest
Unit tests for the Secure Site module

Code

function testLoginAnonymousHTTP() {
  $this
    ->drupalVariableSet('securesite_enabled', SECURESITE_AUTH);
  $this
    ->drupalVariableSet('securesite_filter_pages_type', SECURESITE_WHITELIST);
  $this
    ->drupalVariableSet('securesite_filter_pages', '');
  $this
    ->drupalGet(url(NULL, NULL, NULL, TRUE));
  $this
    ->assertResponse('401', t('Login: Anonymous HTTP Auth') . ': %s');
  $this
    ->assertAuthentication('Basic');
  $this
    ->assertRealm(variable_get('securesite_realm', variable_get('site_name', 'Drupal')));
}