You are here

public function SecKitTestCaseTest::testXframeOptionsIsSameOrigin in Security Kit 8

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

Tests set to SAMEORIGIN X-Frame-Options HTTP response header.

File

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

Class

SecKitTestCaseTest
Functional tests for Security Kit.

Namespace

Drupal\Tests\seckit\Functional

Code

public function testXframeOptionsIsSameOrigin() {
  $form['seckit_clickjacking[x_frame]'] = SeckitInterface::X_FRAME_SAMEORIGIN;
  $this
    ->drupalPostForm('admin/config/system/seckit', $form, t('Save configuration'));
  $this
    ->assertSession()
    ->responseHeaderEquals('X-Frame-Options', 'SAMEORIGIN');
}