You are here

public function SecKitTestCase::testDisabledCSP in Security Kit 7

Same name and namespace in other branches
  1. 6 seckit.test \SecKitTestCase::testDisabledCSP()

Tests disabled Content Security Policy.

File

./seckit.test, line 43
Tests for Security Kit module.

Class

SecKitTestCase
Functional tests for Security Kit.

Code

public function testDisabledCSP() {
  $form['seckit_xss[csp][checkbox]'] = FALSE;
  $this
    ->drupalPost('admin/config/system/seckit', $form, t('Save configuration'));
  $this
    ->assertFalse($this
    ->drupalGetHeader('Content-Security-Policy'), t('Content Security Policy is disabled.'));
  $this
    ->assertFalse($this
    ->drupalGetHeader('X-Content-Security-Policy'), t('Content Security Policy is disabled.'));
  $this
    ->assertFalse($this
    ->drupalGetHeader('X-WebKit-CSP'), t('Content Security Policy is disabled.'));
}