4 namespace Friendica\Test\src\Core\Lock;
6 use Friendica\Core\Cache\MemcachedCache;
7 use Friendica\Core\Config\IConfiguration;
8 use Friendica\Core\Lock\CacheLock;
9 use Psr\Log\NullLogger;
12 * @requires extension memcached
15 class MemcachedCacheLockTest extends LockTest
17 protected function getInstance()
19 $configMock = \Mockery::mock(IConfiguration::class);
21 $host = $_SERVER['MEMCACHED_HOST'] ?? 'localhost';
24 ->shouldReceive('get')
25 ->with('system', 'memcached_hosts')
26 ->andReturn([0 => $host . ', 11211']);
28 $logger = new NullLogger();
33 $cache = new MemcachedCache($host, $configMock, $logger);
34 $lock = new CacheLock($cache);
35 } catch (\Exception $e) {
36 $this->markTestSkipped('Memcached is not available');
42 public function testGetLocks()
44 $this->markTestIncomplete('Race condition because of too fast getLocks() which uses a workaround');
47 public function testGetLocksWithPrefix()
49 $this->markTestIncomplete('Race condition because of too fast getLocks() which uses a workaround');