]> git.mxchange.org Git - friendica.git/blob - tests/src/Core/Cache/RedisCacheTest.php
Rename *CacheDriver to *Cache because they don't act as driver anymore
[friendica.git] / tests / src / Core / Cache / RedisCacheTest.php
1 <?php
2
3
4 namespace Friendica\Test\src\Core\Cache;
5
6 use Friendica\Core\Cache\RedisCache;
7 use Friendica\Core\Config\Configuration;
8
9 /**
10  * @requires extension redis
11  */
12 class RedisCacheTest extends MemoryCacheTest
13 {
14         protected function getInstance()
15         {
16                 $configMock = \Mockery::mock(Configuration::class);
17
18                 $configMock
19                         ->shouldReceive('get')
20                         ->with('system', 'redis_host')
21                         ->andReturn('localhost');
22                 $configMock
23                         ->shouldReceive('get')
24                         ->with('system', 'redis_port')
25                         ->andReturn(null);
26
27                 $configMock
28                         ->shouldReceive('get')
29                         ->with('system', 'redis_db', 0)
30                         ->andReturn(3);
31                 $configMock
32                         ->shouldReceive('get')
33                         ->with('system', 'redis_password')
34                         ->andReturn(null);
35
36                 $this->cache = new RedisCache('localhost', $configMock);
37                 return $this->cache;
38         }
39
40         public function tearDown()
41         {
42                 $this->cache->clear(false);
43                 parent::tearDown();
44         }
45 }