function FormCacheTest::setUp

Same name in this branch
  1. 8.9.x core/tests/Drupal/Tests/Core/Form/FormCacheTest.php \Drupal\Tests\Core\Form\FormCacheTest::setUp()
Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Form/FormCacheTest.php \Drupal\KernelTests\Core\Form\FormCacheTest::setUp()
  2. 9 core/tests/Drupal/Tests/Core/Form/FormCacheTest.php \Drupal\Tests\Core\Form\FormCacheTest::setUp()
  3. 10 core/tests/Drupal/KernelTests/Core/Form/FormCacheTest.php \Drupal\KernelTests\Core\Form\FormCacheTest::setUp()
  4. 10 core/tests/Drupal/Tests/Core/Form/FormCacheTest.php \Drupal\Tests\Core\Form\FormCacheTest::setUp()
  5. 11.x core/tests/Drupal/KernelTests/Core/Form/FormCacheTest.php \Drupal\KernelTests\Core\Form\FormCacheTest::setUp()
  6. 11.x core/tests/Drupal/Tests/Core/Form/FormCacheTest.php \Drupal\Tests\Core\Form\FormCacheTest::setUp()

Overrides KernelTestBase::setUp

File

core/tests/Drupal/KernelTests/Core/Form/FormCacheTest.php, line 41

Class

FormCacheTest
Tests <a href="/api/drupal/core%21lib%21Drupal.php/function/Drupal%3A%3AformBuilder/8.9.x" title="Returns the form builder service." class="local">\Drupal::formBuilder</a>()-&gt;setCache() and <a href="/api/drupal/core%21lib%21Drupal.php/function/Drupal%3A%3AformBuilder/8.9.x" title="Returns the form builder service." class="local">\Drupal::formBuilder</a>()-&gt;getCache().

Namespace

Drupal\KernelTests\Core\Form

Code

protected function setUp() {
    parent::setUp();
    $this->installSchema('system', [
        'key_value_expire',
    ]);
    $this->formBuildId = $this->randomMachineName();
    $this->form = [
        '#property' => $this->randomMachineName(),
    ];
    $this->formState = new FormState();
    $this->formState
        ->set('example', $this->randomMachineName());
}

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