protected function setUp() { $client = new \Predis\Client(); $client->flushdb(); $this->base_cache = new OffloadCacheRedis($client); $this->manager = new OffloadManager($this->base_cache, new OffloadLockRedis($client)); }
/** * Set up dependencies */ public function setUp() { parent::setUp(); $configurationManager = $this->objectManager->get('TYPO3\\Flow\\Configuration\\ConfigurationManager'); $settings = $configurationManager->getConfiguration(\TYPO3\Flow\Configuration\ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'TYPO3.Jobqueue.Redis'); if (!isset($settings['testing']['enabled']) || $settings['testing']['enabled'] !== TRUE) { $this->markTestSkipped('Test database is not configured'); } $this->queue = new \Admaykin\Jobqueue\Redis\Queue\RedisQueue('Test queue', $settings['testing']); $client = new \Predis\Client($settings['testing']['client']); $client->flushdb(); }
/** * Invalidate all items in the cache. * * @param int $delay Number of seconds to wait before invalidating the items. * @return bool Returns TRUE on success or FALSE on failure. */ public function flush($delay = 0) { $delay = abs(intval($delay)); if ($delay) { sleep($delay); } $this->cache = array(); if ($this->redis_status()) { $result = $this->parse_predis_response($this->redis->flushdb()); } return $result; }
protected function setUp() { $client = new \Predis\Client(); $client->flushdb(); $this->cache = new OffloadCacheRedis($client); }
protected function setUp() { $client = new \Predis\Client(); $client->flushdb(); $this->lock = new OffloadLockRedis($client); }
public function dataDetailedSettingCompatibility() { $redis = new \Predis\Client(); $redis->flushdb(); $client_detailed = $this->createClient(true); $client_detailed->setupDirectRedis($redis, $redis); $client_not_detailed = $this->createClient(false); $client_not_detailed->setupDirectRedis($redis, $redis); return [[$client_detailed, $client_not_detailed], [$client_not_detailed, $client_detailed]]; }