]> git.mxchange.org Git - friendica.git/blob - tests/src/Core/Cache/MemcacheCacheDriverTest.php
Refactor ConfigMockTrait to mocked ConfigCache
[friendica.git] / tests / src / Core / Cache / MemcacheCacheDriverTest.php
1 <?php
2
3
4 namespace Friendica\Test\src\Core\Cache;
5
6 use Friendica\Core\Cache\CacheDriverFactory;
7
8 /**
9  * @requires extension memcache
10  */
11 class MemcacheCacheDriverTest extends MemoryCacheTest
12 {
13         protected function getInstance()
14         {
15                 $this->configCache
16                         ->shouldReceive('get')
17                         ->with('system', 'memcache_host', NULL)
18                         ->andReturn('localhost');
19
20                 $this->configCache
21                         ->shouldReceive('get')
22                         ->with('system', 'memcache_port', NULL)
23                         ->andReturn(11211);
24
25                 $this->cache = CacheDriverFactory::create('memcache');
26                 return $this->cache;
27
28         }
29
30         public function tearDown()
31         {
32                 $this->cache->clear(false);
33                 parent::tearDown();
34         }
35 }