/** * Lists all registered cache groups. */ public function listGroupsCommand() { $groups = $this->cacheService->getValidCacheGroups(); sort($groups); switch (count($groups)) { case 0: $this->outputLine('No cache group is registered.'); break; case 1: $this->outputLine('The following cache group is registered: "' . implode('", "', $groups) . '".'); break; default: $this->outputLine('The following cache groups are registered: "' . implode('", "', $groups) . '".'); break; } }
/** * @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')); }