You are here

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

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

Tests set to 1 X-XSS-Protection HTTP response header.

File

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

Class

SecKitTestCaseTest
Functional tests for Security Kit.

Namespace

Drupal\Tests\seckit\Functional

Code

public function testXxssProtectionIs1() {
  $form['seckit_xss[x_xss][select]'] = SeckitInterface::X_XSS_1;
  $this
    ->drupalPostForm('admin/config/system/seckit', $form, t('Save configuration'));
  $this
    ->assertSession()
    ->responseHeaderEquals('X-XSS-Protection', '1');
}