public function FormBuilderTest::testFormCacheDeletionUncached in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php \Drupal\Tests\Core\Form\FormBuilderTest::testFormCacheDeletionUncached()
- 10 core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php \Drupal\Tests\Core\Form\FormBuilderTest::testFormCacheDeletionUncached()
Tests that an uncached form does not trigger cache set or delete.
File
- core/
tests/ Drupal/ Tests/ Core/ Form/ FormBuilderTest.php, line 548 - Contains \Drupal\Tests\Core\Form\FormBuilderTest.
Class
- FormBuilderTest
- @coversDefaultClass \Drupal\Core\Form\FormBuilder @group Form
Namespace
Drupal\Tests\Core\FormCode
public function testFormCacheDeletionUncached() {
$form_id = 'test_form_id';
$form_build_id = $this
->randomMachineName();
$expected_form = $form_id();
$expected_form['#build_id'] = $form_build_id;
$form_arg = $this
->getMockForm($form_id, $expected_form);
$this->formCache
->expects($this
->never())
->method('deleteCache');
$form_state = new FormState();
$this
->simulateFormSubmission($form_id, $form_arg, $form_state);
}