mirror of
https://github.com/friendica/friendica
synced 2025-04-09 00:00:16 +00:00
58 lines
1.1 KiB
PHP
58 lines
1.1 KiB
PHP
<?php
|
|
|
|
|
|
namespace Friendica\Test\src\Core\Lock;
|
|
|
|
use Friendica\Core\Cache\MemcacheCache;
|
|
use Friendica\Core\Config\IConfig;
|
|
use Friendica\Core\Lock\CacheLock;
|
|
|
|
/**
|
|
* @requires extension Memcache
|
|
* @group MEMCACHE
|
|
*/
|
|
class MemcacheCacheLockTest extends LockTest
|
|
{
|
|
protected function getInstance()
|
|
{
|
|
$configMock = \Mockery::mock(IConfig::class);
|
|
|
|
$host = $_SERVER['MEMCACHE_HOST'] ?? 'localhost';
|
|
|
|
$configMock
|
|
->shouldReceive('get')
|
|
->with('system', 'memcache_host')
|
|
->andReturn($host);
|
|
$configMock
|
|
->shouldReceive('get')
|
|
->with('system', 'memcache_port')
|
|
->andReturn(11211);
|
|
|
|
$lock = null;
|
|
|
|
try {
|
|
$cache = new MemcacheCache($host, $configMock);
|
|
$lock = new CacheLock($cache);
|
|
} catch (\Exception $e) {
|
|
$this->markTestSkipped('Memcache is not available');
|
|
}
|
|
|
|
return $lock;
|
|
}
|
|
|
|
/**
|
|
* @small
|
|
*/
|
|
public function testGetLocks()
|
|
{
|
|
$this->markTestIncomplete('Race condition because of too fast getAllKeys() which uses a workaround');
|
|
}
|
|
|
|
/**
|
|
* @small
|
|
*/
|
|
public function testGetLocksWithPrefix()
|
|
{
|
|
$this->markTestIncomplete('Race condition because of too fast getAllKeys() which uses a workaround');
|
|
}
|
|
}
|