function FormCacheTest::setUpMockAccount

Reinitializes the account as a mock object.

8 calls to FormCacheTest::setUpMockAccount()
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.
FormCacheTest::testGetCacheValidToken in core/tests/Drupal/Tests/Core/Form/FormCacheTest.php
Tests get cache valid token.

... See full list

File

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

Class

FormCacheTest
Tests Drupal\Core\Form\FormCache.

Namespace

Drupal\Tests\Core\Form

Code

protected function setUpMockAccount() : void {
  $this->account = $this->createMock(AccountInterface::class);
  $reflection = new \ReflectionProperty($this->formCache, 'currentUser');
  $reflection->setValue($this->formCache, $this->account);
}

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