4 namespace Friendica\Test\src\Core\Cache;
6 use Friendica\Core\Cache\MemcachedCache;
7 use Friendica\Core\Config\Configuration;
8 use Psr\Log\NullLogger;
11 * @requires extension memcached
14 class MemcachedCacheTest extends MemoryCacheTest
16 protected function getInstance()
18 $configMock = \Mockery::mock(Configuration::class);
20 $host = $_SERVER['MEMCACHED_HOST'] ?? 'localhost';
23 ->shouldReceive('get')
24 ->with('system', 'memcached_hosts')
25 ->andReturn([0 => $host . ', 11211']);
27 $logger = new NullLogger();
30 $this->cache = new MemcachedCache($host, $configMock, $logger);
31 } catch (\Exception $exception) {
32 $this->markTestSkipped('Memcached is not available');
37 public function tearDown()
39 $this->cache->clear(false);
46 * @dataProvider dataSimple
48 public function testGetAllKeys($value1, $value2, $value3)
50 $this->markTestIncomplete('Race condition because of too fast getAllKeys() which uses a workaround');