You are here

public function SecKitTestCase::testOriginDeny in Security Kit 7

Same name and namespace in other branches
  1. 6 seckit.test \SecKitTestCase::testOriginDeny()

Tests HTTP Origin denies request.

File

./seckit.test, line 425
Tests for Security Kit module.

Class

SecKitTestCase
Functional tests for Security Kit.

Code

public function testOriginDeny() {
  $form['seckit_csrf[origin]'] = TRUE;
  $this
    ->drupalPost('admin/config/system/seckit', $form, t('Save configuration'));
  $this
    ->drupalPost('admin/config/system/seckit', $form, t('Save configuration'), array(), array(
    'Origin: http://www.example.com',
  ));
  $this
    ->assertEqual(array(), $_POST, t('POST is empty.'));
  $this
    ->assertResponse(403, t('Request is denied.'));
}