public function SecKitTestCase::testDisabledCSP in Security Kit 6
Same name and namespace in other branches
- 7 seckit.test \SecKitTestCase::testDisabledCSP()
Tests disabled Content Security Policy.
File
- ./
seckit.test, line 42 - 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/settings/seckit', $form, t('Save configuration'));
$this
->assertFalse($this
->drupalGetHeader('Content-Security-Policy'), t('Content Security Policy is disabled (Official).'));
$this
->assertFalse($this
->drupalGetHeader('X-Content-Security-Policy'), t('Content Security Policy is disabled (Mozilla and IE10).'));
$this
->assertFalse($this
->drupalGetHeader('X-WebKit-CSP'), t('Content Security Policy is disabled (Chrome and Safari).'));
}