function TokenTest::setUpMockModuleHandler

Reinitializes the module handler as a mock object.

1 call to TokenTest::setUpMockModuleHandler()
TokenTest::testGetInfo in core/tests/Drupal/Tests/Core/Utility/TokenTest.php
Tests get info.

File

core/tests/Drupal/Tests/Core/Utility/TokenTest.php, line 137

Class

TokenTest
Tests Drupal\Core\Utility\Token.

Namespace

Drupal\Tests\Core\Utility

Code

protected function setUpMockModuleHandler() : void {
  $this->moduleHandler = $this->createMock(ModuleHandlerInterface::class);
  $reflection = new \ReflectionProperty($this->token, 'moduleHandler');
  $reflection->setValue($this->token, $this->moduleHandler);
}

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