function ViewsHandlerManagerTest::setUpMockModuleHandler

Reinitializes the module handler as a mock object.

1 call to ViewsHandlerManagerTest::setUpMockModuleHandler()
ViewsHandlerManagerTest::testAlterHookInvocation in core/modules/views/tests/src/Unit/ViewsHandlerManagerTest.php
Tests that hook_views_plugins_TYPE_alter() is invoked for a handler type.

File

core/modules/views/tests/src/Unit/ViewsHandlerManagerTest.php, line 76

Class

ViewsHandlerManagerTest
Tests the ViewsHandlerManager class.

Namespace

Drupal\Tests\views\Unit

Code

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

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