You are here

public function SecKitTestCaseTest::testEnableExpectCt in Security Kit 8

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

Tests Enable Expect-CT.

File

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

Class

SecKitTestCaseTest
Functional tests for Security Kit.

Namespace

Drupal\Tests\seckit\Functional

Code

public function testEnableExpectCt() {
  $form = [
    'seckit_ct[expect_ct]' => TRUE,
    'seckit_ct[max_age]' => 86400,
    'seckit_ct[enforce]' => TRUE,
    'seckit_ct[report_uri]' => 'https://www.example.com/report',
  ];
  $this
    ->drupalPostForm('admin/config/system/seckit', $form, t('Save configuration'));
  $expected = 'max-age=86400, enforce, report-uri="https://www.example.com/report"';
  $this
    ->assertSession()
    ->responseHeaderEquals('Expect-CT', $expected);
}