4 namespace Friendica\Test\src\Core\Lock;
7 use Friendica\Core\Cache\CacheDriverFactory;
8 use Friendica\Core\Lock\CacheLockDriver;
10 class RedisCacheLockDriverTest extends LockTest
13 * @var \Friendica\Core\Cache\IMemoryCacheDriver
17 protected function getInstance()
19 if (class_exists('Redis')) {
21 $this->cache = CacheDriverFactory::create('redis');
22 } catch (\Exception $exception) {
23 print "Redis - TestCase failed: " . $exception->getMessage();
24 throw new \Exception();
26 return new CacheLockDriver($this->cache);
28 $this->markTestSkipped('Redis driver isn\'t available');
33 public function tearDown()
35 if (class_exists('Redis')) {
36 $this->cache->clear();