function ValidationTest::testDisabledToken

Same name in other branches
  1. 9 core/modules/system/tests/src/Functional/Form/ValidationTest.php \Drupal\Tests\system\Functional\Form\ValidationTest::testDisabledToken()
  2. 10 core/modules/system/tests/src/Functional/Form/ValidationTest.php \Drupal\Tests\system\Functional\Form\ValidationTest::testDisabledToken()
  3. 11.x core/modules/system/tests/src/Functional/Form/ValidationTest.php \Drupal\Tests\system\Functional\Form\ValidationTest::testDisabledToken()

Tests that a form with a disabled CSRF token can be validated.

File

core/modules/system/tests/src/Functional/Form/ValidationTest.php, line 83

Class

ValidationTest
Tests form processing and alteration via form validation handlers.

Namespace

Drupal\Tests\system\Functional\Form

Code

public function testDisabledToken() {
    $this->drupalPostForm('form-test/validate-no-token', [], 'Save');
    $this->assertText('The form_test_validate_no_token form has been submitted successfully.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.