function FormStateTest::testIsCached
Tests is cached.
@legacy-covers ::isCached
Attributes
#[DataProvider('providerTestIsCached')]
File
-
core/
tests/ Drupal/ Tests/ Core/ Form/ FormStateTest.php, line 268
Class
Namespace
Drupal\Tests\Core\FormCode
public function testIsCached($cache_key, $no_cache_key, $expected) : void {
$form_state = (new FormState())->setFormState([
'cache' => $cache_key,
'no_cache' => $no_cache_key,
]);
$form_state->setMethod('POST');
$this->assertSame($expected, $form_state->isCached());
$form_state->setMethod('GET');
$this->assertSame($expected, $form_state->isCached());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.