4 namespace Friendica\Test\src\Core\Lock;
6 use Friendica\Core\Cache\MemcachedCache;
7 use Friendica\Core\Config\Configuration;
8 use Friendica\Core\Lock\CacheLock;
9 use Psr\Log\NullLogger;
12 * @requires extension memcached
14 class MemcachedCacheLockTest extends LockTest
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();
32 $cache = new MemcachedCache($host, $configMock, $logger);
33 $lock = new CacheLock($cache);
34 } catch (\Exception $e) {
35 $this->markTestSkipped('Memcached is not available');