X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=tests%2Fsrc%2FCore%2FLock%2FMemcacheCacheLockTest.php;h=98266852f9b808a3e5fd4b258adb69f5120a0403;hb=e6c054c27602a3acadac3c423273bdf748fcee27;hp=cebe246c1926cbec4014acbebefbc7e3dd73f871;hpb=0823f4d72d204f1ea5b22fff0637a8ef5107885b;p=friendica.git diff --git a/tests/src/Core/Lock/MemcacheCacheLockTest.php b/tests/src/Core/Lock/MemcacheCacheLockTest.php index cebe246c19..98266852f9 100644 --- a/tests/src/Core/Lock/MemcacheCacheLockTest.php +++ b/tests/src/Core/Lock/MemcacheCacheLockTest.php @@ -1,11 +1,31 @@ . + * + */ namespace Friendica\Test\src\Core\Lock; +use Exception; use Friendica\Core\Cache\MemcacheCache; -use Friendica\Core\Config\Configuration; +use Friendica\Core\Config\IConfig; use Friendica\Core\Lock\CacheLock; +use Mockery; /** * @requires extension Memcache @@ -15,9 +35,10 @@ class MemcacheCacheLockTest extends LockTest { protected function getInstance() { - $configMock = \Mockery::mock(Configuration::class); + $configMock = Mockery::mock(IConfig::class); $host = $_SERVER['MEMCACHE_HOST'] ?? 'localhost'; + $port = $_SERVER['MEMCACHE_PORT'] ?? '11211'; $configMock ->shouldReceive('get') @@ -26,17 +47,35 @@ class MemcacheCacheLockTest extends LockTest $configMock ->shouldReceive('get') ->with('system', 'memcache_port') - ->andReturn(11211); + ->andReturn($port); $lock = null; try { $cache = new MemcacheCache($host, $configMock); $lock = new CacheLock($cache); - } catch (\Exception $e) { - $this->markTestSkipped('Memcache is not available'); + } catch (Exception $e) { + static::markTestSkipped('Memcache is not available'); } return $lock; } + + /** + * @small + * @doesNotPerformAssertions + */ + public function testGetLocks() + { + static::markTestIncomplete('Race condition because of too fast getAllKeys() which uses a workaround'); + } + + /** + * @small + * @doesNotPerformAssertions + */ + public function testGetLocksWithPrefix() + { + static::markTestIncomplete('Race condition because of too fast getAllKeys() which uses a workaround'); + } }