function FormCacheTest::setUpMockLogger

Reinitializes the logger as a mock object.

1 call to FormCacheTest::setUpMockLogger()
FormCacheTest::testSetCacheBuildIdMismatch in core/tests/Drupal/Tests/Core/Form/FormCacheTest.php
Tests set cache build id mismatch.

File

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

Class

FormCacheTest
Tests Drupal\Core\Form\FormCache.

Namespace

Drupal\Tests\Core\Form

Code

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

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