function FormTestBase::setUpMockFormCacheInterface

Reinitializes the form cache as a mock object.

3 calls to FormTestBase::setUpMockFormCacheInterface()
FormBuilderTest::testFormCacheDeletionCached in core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php
Tests that a cached form is deleted after submit.
FormBuilderTest::testFormCacheDeletionUncached in core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php
Tests that an uncached form does not trigger cache set or delete.
FormBuilderTest::testGetCache in core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php
Tests the getCache() method.

File

core/tests/Drupal/Tests/Core/Form/FormTestBase.php, line 230

Class

FormTestBase
Provides a base class for testing form functionality.

Namespace

Drupal\Tests\Core\Form

Code

protected function setUpMockFormCacheInterface() : void {
  $this->formCache = $this->createMock(FormCacheInterface::class);
  $reflection = new \ReflectionProperty($this->formBuilder, 'formCache');
  $reflection->setValue($this->formBuilder, $this->formCache);
}

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