From 75632a149040b09611364cc37245fd5c71940696 Mon Sep 17 00:00:00 2001 From: Art4 Date: Sun, 15 Dec 2024 21:15:21 +0000 Subject: [PATCH] Rename LockTest to LockTestCase --- tests/{src/Core/Lock/LockTest.php => LockTestCase.php} | 4 ++-- tests/src/Core/Lock/APCuCacheLockTest.php | 5 +++-- tests/src/Core/Lock/ArrayCacheLockTest.php | 5 +++-- tests/src/Core/Lock/DatabaseLockDriverTest.php | 3 ++- tests/src/Core/Lock/MemcacheCacheLockTest.php | 5 +++-- tests/src/Core/Lock/MemcachedCacheLockTest.php | 3 ++- tests/src/Core/Lock/RedisCacheLockTest.php | 5 +++-- tests/src/Core/Lock/SemaphoreLockTest.php | 6 ++++-- 8 files changed, 22 insertions(+), 14 deletions(-) rename tests/{src/Core/Lock/LockTest.php => LockTestCase.php} (98%) diff --git a/tests/src/Core/Lock/LockTest.php b/tests/LockTestCase.php similarity index 98% rename from tests/src/Core/Lock/LockTest.php rename to tests/LockTestCase.php index c32f50e2f6..9ce86497b7 100644 --- a/tests/src/Core/Lock/LockTest.php +++ b/tests/LockTestCase.php @@ -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) diff --git a/tests/src/Core/Lock/APCuCacheLockTest.php b/tests/src/Core/Lock/APCuCacheLockTest.php index f0ac1a0ec6..3ee0d09661 100644 --- a/tests/src/Core/Lock/APCuCacheLockTest.php +++ b/tests/src/Core/Lock/APCuCacheLockTest.php @@ -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')); } } diff --git a/tests/src/Core/Lock/ArrayCacheLockTest.php b/tests/src/Core/Lock/ArrayCacheLockTest.php index 0c09b004f8..19ac7925c6 100644 --- a/tests/src/Core/Lock/ArrayCacheLockTest.php +++ b/tests/src/Core/Lock/ArrayCacheLockTest.php @@ -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')); } /** diff --git a/tests/src/Core/Lock/DatabaseLockDriverTest.php b/tests/src/Core/Lock/DatabaseLockDriverTest.php index b4dc526b89..ebc2b0090f 100644 --- a/tests/src/Core/Lock/DatabaseLockDriverTest.php +++ b/tests/src/Core/Lock/DatabaseLockDriverTest.php @@ -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; diff --git a/tests/src/Core/Lock/MemcacheCacheLockTest.php b/tests/src/Core/Lock/MemcacheCacheLockTest.php index f23870779a..2bb0595cff 100644 --- a/tests/src/Core/Lock/MemcacheCacheLockTest.php +++ b/tests/src/Core/Lock/MemcacheCacheLockTest.php @@ -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'); } diff --git a/tests/src/Core/Lock/MemcachedCacheLockTest.php b/tests/src/Core/Lock/MemcachedCacheLockTest.php index 2936bfec9a..fb38ec3312 100644 --- a/tests/src/Core/Lock/MemcachedCacheLockTest.php +++ b/tests/src/Core/Lock/MemcachedCacheLockTest.php @@ -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() { diff --git a/tests/src/Core/Lock/RedisCacheLockTest.php b/tests/src/Core/Lock/RedisCacheLockTest.php index 834d2bb8c4..d0237682c3 100644 --- a/tests/src/Core/Lock/RedisCacheLockTest.php +++ b/tests/src/Core/Lock/RedisCacheLockTest.php @@ -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()); } diff --git a/tests/src/Core/Lock/SemaphoreLockTest.php b/tests/src/Core/Lock/SemaphoreLockTest.php index 407e68afaf..06b4e02f46 100644 --- a/tests/src/Core/Lock/SemaphoreLockTest.php +++ b/tests/src/Core/Lock/SemaphoreLockTest.php @@ -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(); } /**