You are here

public function SecKitTestCase::testOriginAllowsSite in Security Kit 6

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

Tests HTTP Origin allows requests from the site.

File

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

Class

SecKitTestCase
Functional tests for Security Kit.

Code

public function testOriginAllowsSite() {
  global $base_url;
  $form['seckit_csrf[origin]'] = TRUE;
  $this
    ->drupalPost('admin/settings/seckit', $form, t('Save configuration'));
  $this
    ->drupalPost('admin/settings/seckit', $form, t('Save configuration'), array(), array(
    'Origin: ' . $base_url,
  ));
  $this
    ->assertResponse(200, t('Request is allowed.'));
}