mirror of
https://github.com/friendica/friendica
synced 2024-12-22 08:00:16 +00:00
Rename LockTest to LockTestCase
This commit is contained in:
parent
a676e738e0
commit
75632a1490
8 changed files with 22 additions and 14 deletions
|
@ -5,12 +5,12 @@
|
|||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
namespace Friendica\Test\src\Core\Lock;
|
||||
namespace Friendica\Test;
|
||||
|
||||
use Friendica\Core\Lock\Capability\ICanLock;
|
||||
use Friendica\Test\MockedTestCase;
|
||||
|
||||
abstract class LockTest extends MockedTestCase
|
||||
abstract class LockTestCase extends MockedTestCase
|
||||
{
|
||||
/**
|
||||
* @var int Start time of the mock (used for time operations)
|
|
@ -9,11 +9,12 @@ namespace Friendica\Test\src\Core\Lock;
|
|||
|
||||
use Friendica\Core\Cache\Type\APCuCache;
|
||||
use Friendica\Core\Lock\Type\CacheLock;
|
||||
use Friendica\Test\LockTestCase;
|
||||
|
||||
/**
|
||||
* @group APCU
|
||||
*/
|
||||
class APCuCacheLockTest extends LockTest
|
||||
class APCuCacheLockTest extends LockTestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
|
@ -26,6 +27,6 @@ class APCuCacheLockTest extends LockTest
|
|||
|
||||
protected function getInstance()
|
||||
{
|
||||
return new \Friendica\Core\Lock\Type\CacheLock(new APCuCache('localhost'));
|
||||
return new CacheLock(new APCuCache('localhost'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,12 +9,13 @@ namespace Friendica\Test\src\Core\Lock;
|
|||
|
||||
use Friendica\Core\Cache\Type\ArrayCache;
|
||||
use Friendica\Core\Lock\Type\CacheLock;
|
||||
use Friendica\Test\LockTestCase;
|
||||
|
||||
class ArrayCacheLockTest extends LockTest
|
||||
class ArrayCacheLockTest extends LockTestCase
|
||||
{
|
||||
protected function getInstance()
|
||||
{
|
||||
return new \Friendica\Core\Lock\Type\CacheLock(new ArrayCache('localhost'));
|
||||
return new CacheLock(new ArrayCache('localhost'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,9 +8,10 @@
|
|||
namespace Friendica\Test\src\Core\Lock;
|
||||
|
||||
use Friendica\Core\Lock\Type\DatabaseLock;
|
||||
use Friendica\Test\LockTestCase;
|
||||
use Friendica\Test\Util\CreateDatabaseTrait;
|
||||
|
||||
class DatabaseLockDriverTest extends LockTest
|
||||
class DatabaseLockDriverTest extends LockTestCase
|
||||
{
|
||||
use CreateDatabaseTrait;
|
||||
|
||||
|
|
|
@ -11,13 +11,14 @@ use Exception;
|
|||
use Friendica\Core\Cache\Type\MemcacheCache;
|
||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||
use Friendica\Core\Lock\Type\CacheLock;
|
||||
use Friendica\Test\LockTestCase;
|
||||
use Mockery;
|
||||
|
||||
/**
|
||||
* @requires extension Memcache
|
||||
* @group MEMCACHE
|
||||
*/
|
||||
class MemcacheCacheLockTest extends LockTest
|
||||
class MemcacheCacheLockTest extends LockTestCase
|
||||
{
|
||||
protected function getInstance()
|
||||
{
|
||||
|
@ -39,7 +40,7 @@ class MemcacheCacheLockTest extends LockTest
|
|||
|
||||
try {
|
||||
$cache = new MemcacheCache($host, $configMock);
|
||||
$lock = new \Friendica\Core\Lock\Type\CacheLock($cache);
|
||||
$lock = new CacheLock($cache);
|
||||
} catch (Exception $e) {
|
||||
static::markTestSkipped('Memcache is not available');
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ use Exception;
|
|||
use Friendica\Core\Cache\Type\MemcachedCache;
|
||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||
use Friendica\Core\Lock\Type\CacheLock;
|
||||
use Friendica\Test\LockTestCase;
|
||||
use Mockery;
|
||||
use Psr\Log\NullLogger;
|
||||
|
||||
|
@ -18,7 +19,7 @@ use Psr\Log\NullLogger;
|
|||
* @requires extension memcached
|
||||
* @group MEMCACHED
|
||||
*/
|
||||
class MemcachedCacheLockTest extends LockTest
|
||||
class MemcachedCacheLockTest extends LockTestCase
|
||||
{
|
||||
protected function getInstance()
|
||||
{
|
||||
|
|
|
@ -11,13 +11,14 @@ use Exception;
|
|||
use Friendica\Core\Cache\Type\RedisCache;
|
||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||
use Friendica\Core\Lock\Type\CacheLock;
|
||||
use Friendica\Test\LockTestCase;
|
||||
use Mockery;
|
||||
|
||||
/**
|
||||
* @requires extension redis
|
||||
* @group REDIS
|
||||
*/
|
||||
class RedisCacheLockTest extends LockTest
|
||||
class RedisCacheLockTest extends LockTestCase
|
||||
{
|
||||
protected function getInstance()
|
||||
{
|
||||
|
@ -48,7 +49,7 @@ class RedisCacheLockTest extends LockTest
|
|||
|
||||
try {
|
||||
$cache = new RedisCache($host, $configMock);
|
||||
$lock = new \Friendica\Core\Lock\Type\CacheLock($cache);
|
||||
$lock = new CacheLock($cache);
|
||||
} catch (Exception $e) {
|
||||
static::markTestSkipped('Redis is not available. Error: ' . $e->getMessage());
|
||||
}
|
||||
|
|
|
@ -12,12 +12,14 @@ use Friendica\App;
|
|||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||
use Friendica\Core\Config\Model\ReadOnlyFileConfig;
|
||||
use Friendica\Core\Config\ValueObject\Cache;
|
||||
use Friendica\Core\Lock\Type\SemaphoreLock;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\DI;
|
||||
use Friendica\Test\LockTestCase;
|
||||
use Mockery;
|
||||
use Mockery\MockInterface;
|
||||
|
||||
class SemaphoreLockTest extends LockTest
|
||||
class SemaphoreLockTest extends LockTestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
|
@ -40,7 +42,7 @@ class SemaphoreLockTest extends LockTest
|
|||
|
||||
protected function getInstance()
|
||||
{
|
||||
return new \Friendica\Core\Lock\Type\SemaphoreLock();
|
||||
return new SemaphoreLock();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue