You are here

function SecureSiteTest::testUserAgentDefault in Secure Site 6

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

Check that the realm is correct when using the HTTP Auth method with the default SimpleTest User Agent string

File

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

Class

SecureSiteTest
Unit tests for the Secure Site module

Code

function testUserAgentDefault() {
  $this
    ->drupalVariableSet('securesite_enabled', SECURESITE_AUTH);
  $this
    ->drupalVariableSet('securesite_filter_pages_type', SECURESITE_WHITELIST);
  $this
    ->drupalVariableSet('securesite_filter_pages', '');
  $this
    ->drupalGet(url(NULL, array(
    'absolute' => TRUE,
  )));
  $this
    ->assertResponse('401', t('UA Test #1') . ': %s');
  $this
    ->assertAuthentication('Basic');
  $this
    ->assertRealm(variable_get('securesite_realm', variable_get('site_name', 'Drupal')));
}