friendica/tests/src/Core/Cache/MemcacheCacheTest.php

53 lines
1.1 KiB
PHP
Raw Normal View History

2018-07-07 20:07:07 +02:00
<?php
namespace Friendica\Test\src\Core\Cache;
use Friendica\Core\Cache\MemcacheCache;
use Friendica\Core\Config\Configuration;
2018-07-07 20:07:07 +02:00
/**
* @requires extension memcache
2019-09-23 14:31:13 +02:00
* @group MEMCACHE
*/
class MemcacheCacheTest extends MemoryCacheTest
2018-07-07 20:07:07 +02:00
{
protected function getInstance()
{
$configMock = \Mockery::mock(Configuration::class);
$host = $_SERVER['MEMCACHE_HOST'] ?? 'localhost';
$configMock
->shouldReceive('get')
2019-02-17 21:41:45 +01:00
->with('system', 'memcache_host')
->andReturn($host);
$configMock
->shouldReceive('get')
2019-02-17 21:41:45 +01:00
->with('system', 'memcache_port')
->andReturn(11211);
try {
$this->cache = new MemcacheCache($host, $configMock);
} catch (\Exception $e) {
$this->markTestSkipped('Memcache is not available');
}
return $this->cache;
2018-07-07 20:07:07 +02:00
}
public function tearDown()
{
$this->cache->clear(false);
2018-07-07 20:07:07 +02:00
parent::tearDown();
}
/**
* @small
*
* @dataProvider dataSimple
*/
public function testGetAllKeys($value1, $value2, $value3)
{
$this->markTestIncomplete('Race condition because of too fast getAllKeys() which uses a workaround');
}
2018-07-07 20:07:07 +02:00
}