public function SecKitTestCase::testHSTSAllDirectves in Security Kit 6
Same name and namespace in other branches
- 7 seckit.test \SecKitTestCase::testHSTSAllDirectves()
Tests HTTP Strict Transport Security has all directives.
File
- ./
seckit.test, line 311 - Tests for Security Kit module.
Class
- SecKitTestCase
- Functional tests for Security Kit.
Code
public function testHSTSAllDirectves() {
$form = array(
'seckit_ssl[hsts]' => TRUE,
'seckit_ssl[hsts_max_age]' => 1000,
'seckit_ssl[hsts_subdomains]' => 1,
);
$this
->drupalPost('admin/settings/seckit', $form, t('Save configuration'));
$expected = 'max-age=1000; includeSubDomains';
$this
->assertEqual($expected, $this
->drupalGetHeader('Strict-Transport-Security'), t('HTTP Strict Transport Security has all the directives.'));
}