You are here

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

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

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

File

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

Class

SecKitTestCaseTest
Functional tests for Security Kit.

Namespace

Drupal\Tests\seckit\Functional

Code

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