4 namespace Friendica\Test\src\Core\Cache;
6 use Friendica\Core\Cache\RedisCache;
7 use Friendica\Core\Config\IConfiguration;
10 * @requires extension redis
13 class RedisCacheTest extends MemoryCacheTest
15 protected function getInstance()
17 $configMock = \Mockery::mock(IConfiguration::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')
40 $this->cache = new RedisCache($host, $configMock);
41 } catch (\Exception $e) {
42 $this->markTestSkipped('Redis is not available.');
47 public function tearDown()
49 $this->cache->clear(false);