4 namespace Friendica\Test\src\Core\Lock;
6 use Friendica\Core\Cache\RedisCache;
7 use Friendica\Core\Config\Configuration;
8 use Friendica\Core\Lock\CacheLock;
11 * @requires extension redis
13 class RedisCacheLockTest extends LockTest
15 protected function getInstance()
17 $configMock = \Mockery::mock(Configuration::class);
19 $host = $_SERVER['REDIS_HOST'] ?? 'localhost';
22 ->shouldReceive('get')
23 ->with('system', 'redis_host')
26 ->shouldReceive('get')
27 ->with('system', 'redis_port')
31 ->shouldReceive('get')
32 ->with('system', 'redis_db', 0)
35 ->shouldReceive('get')
36 ->with('system', 'redis_password')
42 $cache = new RedisCache($host, $configMock);
43 $lock = new CacheLock($cache);
44 } catch (\Exception $e) {
45 $this->markTestSkipped('Redis is not available');