You are here

public function SecKitTestCaseTest::testDisabledHsts in Security Kit 2.x

Same name and namespace in other branches
  1. 8 tests/src/Functional/SecKitTestCaseTest.php \Drupal\Tests\seckit\Functional\SecKitTestCaseTest::testDisabledHsts()

Tests disabled HTTP Strict Transport Security.

File

tests/src/Functional/SecKitTestCaseTest.php, line 510

Class

SecKitTestCaseTest
Functional tests for Security Kit.

Namespace

Drupal\Tests\seckit\Functional

Code

public function testDisabledHsts() {
  $form['seckit_ssl[hsts]'] = FALSE;
  $this
    ->drupalPostForm('admin/config/system/seckit', $form, t('Save configuration'));
  $this
    ->assertSession()
    ->responseHeaderEquals('Strict-Transport-Security', NULL);
}