You are here

function SecureSiteTest::testUserAgentDefault in Secure Site 5

Same name and namespace in other branches
  1. 6 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 483
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, NULL, NULL, TRUE));
  $this
    ->assertResponse('401', t('UA Test #1') . ': %s');
  $this
    ->assertAuthentication('Basic');
  $this
    ->assertRealm(variable_get('securesite_realm', variable_get('site_name', 'Drupal')));
}