public function testClearCaches() { $this->mockCachePoolIterator(); $this->cache[0]->expects($this->once())->method('clean'); $this->cache[1]->expects($this->once())->method('clean'); $this->object->clearCaches(); }
/** * Sets specified modules to enabled or disabled state * * Performs other necessary routines, such as cache cleanup * * @param bool $isEnabled * @param string[] $modules * @return void */ public function setIsEnabled($isEnabled, $modules) { $result = []; foreach ($this->getAllModules($modules) as $name) { $currentStatus = $this->list->has($name); if (in_array($name, $modules)) { $result[$name] = $isEnabled; } else { $result[$name] = $currentStatus; } } $segment = $this->deploymentConfigFactory->create($result); $this->writer->update($segment); $this->cleanup->clearCaches(); $this->cleanup->clearCodeGeneratedFiles(); }