public function cacheLevelAction() { $domain = $this->params('domain'); $level = $this->params('level'); if (null === $level) { return sprintf("\nCache level for \"%s\" domain: %s\n\n", $domain, $this->settingsService->getCacheLevel($domain)); } $this->settingsService->setCacheLevel($domain, $level); return sprintf("\nCache level for domain %s changed\n\n", $domain); }
public function testSetCacheLevel() { $cacheLevel = SettingsService::CACHE_LEVEL_BASIC; $this->service->expects($this->once())->method('send')->with(array('a' => 'cache_lvl', 'z' => 'domain.com', 'v' => $cacheLevel)); $this->service->setCacheLevel('domain.com', $cacheLevel); }