/** * 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 */ public function cacheGroupsAreRetrievedCorrectlyFromConfiguration() { $this->setCacheConfiguration(array('cache_foo' => array('groups' => array('first', 'second')), 'cache_bar' => array('groups' => array('third', 'second')), 'cache_baz' => array('groups' => array('first', 'third')))); $expectedResult = array('first', 'second', 'third'); $this->assertSame($expectedResult, $this->subject->getValidCacheGroups()); }