You are here

public function SecKitTestCase::testOriginAllowsSite in Security Kit 7

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

Tests HTTP Origin allows requests from the site.

File

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

Class

SecKitTestCase
Functional tests for Security Kit.

Code

public function testOriginAllowsSite() {
  global $base_root;
  $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: ' . $base_root,
  ));
  $this
    ->assertResponse(200, t('Request is allowed.'));
}