function ModuleHandlerTest::testWriteCache

Test that write cache calls through to cache library correctly.

@covers ::writeCache

File

core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php, line 423

Class

ModuleHandlerTest
@coversDefaultClass \Drupal\Core\Extension\ModuleHandler[[api-linebreak]] @runTestsInSeparateProcesses

Namespace

Drupal\Tests\Core\Extension

Code

public function testWriteCache() {
  $module_handler = $this->getModuleHandler();
  $this->cacheBackend
    ->expects($this->exactly(2))
    ->method('get')
    ->will($this->returnValue(NULL));
  $this->cacheBackend
    ->expects($this->exactly(2))
    ->method('set')
    ->with($this->logicalOr('module_implements', 'hook_info'));
  $module_handler->getImplementations('hook');
  $module_handler->writeCache();
}

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