You are here

function SecureSiteTest::testBlacklist in Secure Site 5

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

Test blacklist

File

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

Class

SecureSiteTest
Unit tests for the Secure Site module

Code

function testBlacklist() {
  $this
    ->drupalVariableSet('securesite_enabled', SECURESITE_AUTH);
  $this
    ->drupalVariableSet('securesite_filter_pages_type', SECURESITE_BLACKLIST);
  $this
    ->drupalVariableSet('securesite_filter_pages', 'admin/*');
  $this
    ->drupalGet(url('admin/content', NULL, NULL, TRUE));
  $this
    ->assertResponse('401', t('Blacklist') . ': %s');
  $this
    ->assertAuthentication('Basic');
  $this
    ->assertRealm(variable_get('securesite_realm', variable_get('site_name', 'Drupal')));
}