4 namespace Friendica\Test\src\Core\Lock;
6 use Friendica\Core\Cache\MemcacheCache;
7 use Friendica\Core\Config\IConfiguration;
8 use Friendica\Core\Lock\CacheLock;
11 * @requires extension Memcache
14 class MemcacheCacheLockTest extends LockTest
16 protected function getInstance()
18 $configMock = \Mockery::mock(IConfiguration::class);
20 $host = $_SERVER['MEMCACHE_HOST'] ?? 'localhost';
23 ->shouldReceive('get')
24 ->with('system', 'memcache_host')
27 ->shouldReceive('get')
28 ->with('system', 'memcache_port')
34 $cache = new MemcacheCache($host, $configMock);
35 $lock = new CacheLock($cache);
36 } catch (\Exception $e) {
37 $this->markTestSkipped('Memcache is not available');
46 public function testGetLocks()
48 $this->markTestIncomplete('Race condition because of too fast getAllKeys() which uses a workaround');
54 public function testGetLocksWithPrefix()
56 $this->markTestIncomplete('Race condition because of too fast getAllKeys() which uses a workaround');