public function testClearMaterializedViewFiles() { $static = $this->getDirectoryCleanMock(); $var = $this->getDirectoryCleanMock(DirectoryList::TMP_MATERIALIZATION_DIR); $this->filesystem->expects($this->exactly(2))->method('getDirectoryWrite')->will($this->returnValueMap([[DirectoryList::STATIC_VIEW, DriverPool::FILE, $static], [DirectoryList::VAR_DIR, DriverPool::FILE, $var]])); $this->object->clearMaterializedViewFiles(); }
/** * 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(); }