public function FormStateTest::testSetCachedGet in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Form/FormStateTest.php \Drupal\Tests\Core\Form\FormStateTest::testSetCachedGet()
@covers ::setCached
File
- core/
tests/ Drupal/ Tests/ Core/ Form/ FormStateTest.php, line 318 - Contains \Drupal\Tests\Core\Form\FormStateTest.
Class
- FormStateTest
- @coversDefaultClass \Drupal\Core\Form\FormState
Namespace
Drupal\Tests\Core\FormCode
public function testSetCachedGet() {
$form_state = new FormState();
$form_state
->setRequestMethod('GET');
$this
->expectException(\LogicException::class);
$this
->expectExceptionMessage('Form state caching on GET requests is not allowed.');
$form_state
->setCached();
}