X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=tests%2Fsrc%2FCore%2FLock%2FMemcacheCacheLockTest.php;h=98266852f9b808a3e5fd4b258adb69f5120a0403;hb=e6c054c27602a3acadac3c423273bdf748fcee27;hp=e66c4725c17be7f87a9d691915db0a8beceb4133;hpb=4d749efceec08a1f8e885d7b80a3443bca7d02c7;p=friendica.git diff --git a/tests/src/Core/Lock/MemcacheCacheLockTest.php b/tests/src/Core/Lock/MemcacheCacheLockTest.php index e66c4725c1..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,15 +47,15 @@ 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; @@ -42,17 +63,19 @@ class MemcacheCacheLockTest extends LockTest /** * @small + * @doesNotPerformAssertions */ public function testGetLocks() { - $this->markTestIncomplete('Race condition because of too fast getAllKeys() which uses a workaround'); + static::markTestIncomplete('Race condition because of too fast getAllKeys() which uses a workaround'); } /** * @small + * @doesNotPerformAssertions */ public function testGetLocksWithPrefix() { - $this->markTestIncomplete('Race condition because of too fast getAllKeys() which uses a workaround'); + static::markTestIncomplete('Race condition because of too fast getAllKeys() which uses a workaround'); } }