]> git.mxchange.org Git - friendica.git/blob - tests/src/Core/Cache/RedisCacheDriverTest.php
Merge pull request #7029 from nupplaphil/task/mod_manifest
[friendica.git] / tests / src / Core / Cache / RedisCacheDriverTest.php
1 <?php
2
3
4 namespace Friendica\Test\src\Core\Cache;
5
6 use Friendica\Factory\CacheDriverFactory;
7
8 /**
9  * @requires extension redis
10  */
11 class RedisCacheDriverTest extends MemoryCacheTest
12 {
13         protected function getInstance()
14         {
15                 $this->configMock
16                         ->shouldReceive('get')
17                         ->with('system', 'redis_host')
18                         ->andReturn('localhost');
19
20                 $this->configMock
21                         ->shouldReceive('get')
22                         ->with('system', 'redis_port')
23                         ->andReturn(null);
24
25                 $this->configMock
26                         ->shouldReceive('get')
27                         ->with('system', 'redis_db')
28                         ->andReturn(3);
29
30                 $this->configMock
31                         ->shouldReceive('get')
32                         ->with('system', 'redis_password')
33                         ->andReturn(null);
34
35                 $this->cache = CacheDriverFactory::create('redis');
36                 return $this->cache;
37         }
38
39         public function tearDown()
40         {
41                 $this->cache->clear(false);
42                 parent::tearDown();
43         }
44 }