You are here

protected function ConfigUpdateUnitTestBase::getModuleHandlerMock in Configuration Update Manager 8

Creates a mock module handler for the test.

File

tests/src/Unit/ConfigUpdateUnitTestBase.php, line 273

Class

ConfigUpdateUnitTestBase
Base class for unit testing in Config Update Manager.

Namespace

Drupal\Tests\config_update\Unit

Code

protected function getModuleHandlerMock() {
  $manager = $this
    ->getMockBuilder('Drupal\\Core\\Extension\\ModuleHandlerInterface')
    ->getMock();
  $manager
    ->method('getModuleList')
    ->willReturn([
    'foo_module' => '',
    'standard' => '',
  ]);
  return $manager;
}