function FormCacheTest::setUpMockFormCacheStore

Reinitializes the form cache store as a mock object.

12 calls to FormCacheTest::setUpMockFormCacheStore()
FormCacheTest::testDeleteCache in core/tests/Drupal/Tests/Core/Form/FormCacheTest.php
Tests delete cache.
FormCacheTest::testGetCacheAnonUser in core/tests/Drupal/Tests/Core/Form/FormCacheTest.php
Tests get cache anon user.
FormCacheTest::testGetCacheAuthUser in core/tests/Drupal/Tests/Core/Form/FormCacheTest.php
Tests get cache auth user.
FormCacheTest::testGetCacheInvalidToken in core/tests/Drupal/Tests/Core/Form/FormCacheTest.php
Tests get cache invalid token.
FormCacheTest::testGetCacheNoForm in core/tests/Drupal/Tests/Core/Form/FormCacheTest.php
Tests get cache no form.

... See full list

File

core/tests/Drupal/Tests/Core/Form/FormCacheTest.php, line 133

Class

FormCacheTest
Tests Drupal\Core\Form\FormCache.

Namespace

Drupal\Tests\Core\Form

Code

protected function setUpMockFormCacheStore() : void {
  $this->formCacheStore = $this->createMock(KeyValueStoreExpirableInterface::class);
  $reflection = new \ReflectionProperty($this->keyValueExpirableFactory, 'stores');
  $value = $reflection->getValue($this->keyValueExpirableFactory);
  $value['form'] = $this->formCacheStore;
  $reflection->setValue($this->keyValueExpirableFactory, $value);
}

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