Example #1
0
 /**
  * Test internal implementation cache reset.
  *
  * @covers ::resetImplementations()
  */
 public function testResetImplementations()
 {
     // Prime caches
     $this->moduleHandler->getImplementations('hook');
     $this->moduleHandler->getHookInfo();
     // Reset all caches internal and external.
     $this->cacheBackend->expects($this->once())->method('delete')->with('hook_info');
     $this->cacheBackend->expects($this->exactly(2))->method('set')->with($this->logicalOr('module_implements', 'hook_info'));
     $this->moduleHandler->resetImplementations();
     // Request implementation and ensure hook_info and module_implements skip
     // local caches.
     $this->cacheBackend->expects($this->exactly(2))->method('get')->with($this->logicalOr('module_implements', 'hook_info'));
     $this->moduleHandler->getImplementations('hook');
 }