/** * Flushes all caches in specified groups. * * @param array $groups */ public function flushGroupsCommand(array $groups) { try { $this->cacheService->flushGroups($groups); $this->outputLine('Flushed all caches for group(s): "' . implode('","', $groups) . '"'); } catch (NoSuchCacheGroupException $e) { $this->outputLine($e->getMessage()); $this->sendAndExit(1); } }
/** * @test * @expectedException \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheGroupException */ public function flushByGroupThrowsExceptionForInvalidGroups() { $this->setCacheConfiguration(array('cache_foo' => array('groups' => array('first', 'second')), 'cache_bar' => array('groups' => array('third', 'second')), 'cache_baz' => array('groups' => array('first', 'third')))); $this->subject->flushGroups(array('not', 'first')); }