You are here

public function ModuleHandlerTest::testWriteCache in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php \Drupal\Tests\Core\Extension\ModuleHandlerTest::testWriteCache()

Test that write cache calls through to cache library correctly.

@covers ::writeCache

File

core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php, line 402
Contains \Drupal\Tests\Core\Extension\ModuleHandlerTest.

Class

ModuleHandlerTest
@coversDefaultClass \Drupal\Core\Extension\ModuleHandler @group Extension

Namespace

Drupal\Tests\Core\Extension

Code

public function testWriteCache() {
  $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'));
  $this->moduleHandler
    ->getImplementations('hook');
  $this->moduleHandler
    ->writeCache();
}