4 namespace Friendica\Test\src\Core\Lock;
6 use Friendica\Core\Cache\RedisCache;
7 use Friendica\Core\Config\IConfiguration;
8 use Friendica\Core\Lock\CacheLock;
11 * @requires extension redis
14 class RedisCacheLockTest extends LockTest
16 protected function getInstance()
18 $configMock = \Mockery::mock(IConfiguration::class);
20 $host = $_SERVER['REDIS_HOST'] ?? 'localhost';
23 ->shouldReceive('get')
24 ->with('system', 'redis_host')
27 ->shouldReceive('get')
28 ->with('system', 'redis_port')
32 ->shouldReceive('get')
33 ->with('system', 'redis_db', 0)
36 ->shouldReceive('get')
37 ->with('system', 'redis_password')
43 $cache = new RedisCache($host, $configMock);
44 $lock = new CacheLock($cache);
45 } catch (\Exception $e) {
46 $this->markTestSkipped('Redis is not available');