From a676e738e0d18edf327ec099d89de1fe09ce187a Mon Sep 17 00:00:00 2001 From: Art4 Date: Sun, 15 Dec 2024 21:09:57 +0000 Subject: [PATCH] Rename MemoryCacheTest to MemoryCacheTestCase --- .../Cache/MemoryCacheTest.php => MemoryCacheTestCase.php} | 5 ++--- tests/src/Core/Cache/APCuCacheTest.php | 3 ++- tests/src/Core/Cache/ArrayCacheTest.php | 3 ++- tests/src/Core/Cache/MemcacheCacheTest.php | 3 ++- tests/src/Core/Cache/MemcachedCacheTest.php | 3 ++- tests/src/Core/Cache/RedisCacheTest.php | 5 +++-- 6 files changed, 13 insertions(+), 9 deletions(-) rename tests/{src/Core/Cache/MemoryCacheTest.php => MemoryCacheTestCase.php} (96%) diff --git a/tests/src/Core/Cache/MemoryCacheTest.php b/tests/MemoryCacheTestCase.php similarity index 96% rename from tests/src/Core/Cache/MemoryCacheTest.php rename to tests/MemoryCacheTestCase.php index e6c82d3f14..7563ff701b 100644 --- a/tests/src/Core/Cache/MemoryCacheTest.php +++ b/tests/MemoryCacheTestCase.php @@ -5,13 +5,12 @@ // // SPDX-License-Identifier: AGPL-3.0-or-later -namespace Friendica\Test\src\Core\Cache; +namespace Friendica\Test; use Exception; use Friendica\Core\Cache\Capability\ICanCacheInMemory; -use Friendica\Test\CacheTestCase; -abstract class MemoryCacheTest extends CacheTestCase +abstract class MemoryCacheTestCase extends CacheTestCase { /** * @var \Friendica\Core\Cache\Capability\ICanCacheInMemory diff --git a/tests/src/Core/Cache/APCuCacheTest.php b/tests/src/Core/Cache/APCuCacheTest.php index f66930a9f6..117c211b04 100644 --- a/tests/src/Core/Cache/APCuCacheTest.php +++ b/tests/src/Core/Cache/APCuCacheTest.php @@ -8,11 +8,12 @@ namespace Friendica\Test\src\Core\Cache; use Friendica\Core\Cache\Type\APCuCache; +use Friendica\Test\MemoryCacheTestCase; /** * @group APCU */ -class APCuCacheTest extends MemoryCacheTest +class APCuCacheTest extends MemoryCacheTestCase { protected function setUp(): void { diff --git a/tests/src/Core/Cache/ArrayCacheTest.php b/tests/src/Core/Cache/ArrayCacheTest.php index ee82f6ef57..967cb07bce 100644 --- a/tests/src/Core/Cache/ArrayCacheTest.php +++ b/tests/src/Core/Cache/ArrayCacheTest.php @@ -8,8 +8,9 @@ namespace Friendica\Test\src\Core\Cache; use Friendica\Core\Cache\Type\ArrayCache; +use Friendica\Test\MemoryCacheTestCase; -class ArrayCacheTest extends MemoryCacheTest +class ArrayCacheTest extends MemoryCacheTestCase { protected function getInstance() { diff --git a/tests/src/Core/Cache/MemcacheCacheTest.php b/tests/src/Core/Cache/MemcacheCacheTest.php index f5ac4dafb6..abd073f483 100644 --- a/tests/src/Core/Cache/MemcacheCacheTest.php +++ b/tests/src/Core/Cache/MemcacheCacheTest.php @@ -10,13 +10,14 @@ namespace Friendica\Test\src\Core\Cache; use Exception; use Friendica\Core\Cache\Type\MemcacheCache; use Friendica\Core\Config\Capability\IManageConfigValues; +use Friendica\Test\MemoryCacheTestCase; use Mockery; /** * @requires extension memcache * @group MEMCACHE */ -class MemcacheCacheTest extends MemoryCacheTest +class MemcacheCacheTest extends MemoryCacheTestCase { protected function getInstance() { diff --git a/tests/src/Core/Cache/MemcachedCacheTest.php b/tests/src/Core/Cache/MemcachedCacheTest.php index e191347cf7..f3b6107b5b 100644 --- a/tests/src/Core/Cache/MemcachedCacheTest.php +++ b/tests/src/Core/Cache/MemcachedCacheTest.php @@ -10,6 +10,7 @@ namespace Friendica\Test\src\Core\Cache; use Exception; use Friendica\Core\Cache\Type\MemcachedCache; use Friendica\Core\Config\Capability\IManageConfigValues; +use Friendica\Test\MemoryCacheTestCase; use Mockery; use Psr\Log\NullLogger; @@ -17,7 +18,7 @@ use Psr\Log\NullLogger; * @requires extension memcached * @group MEMCACHED */ -class MemcachedCacheTest extends MemoryCacheTest +class MemcachedCacheTest extends MemoryCacheTestCase { protected function getInstance() { diff --git a/tests/src/Core/Cache/RedisCacheTest.php b/tests/src/Core/Cache/RedisCacheTest.php index db1bf3f70b..6169171f40 100644 --- a/tests/src/Core/Cache/RedisCacheTest.php +++ b/tests/src/Core/Cache/RedisCacheTest.php @@ -10,13 +10,14 @@ namespace Friendica\Test\src\Core\Cache; use Exception; use Friendica\Core\Cache\Type\RedisCache; use Friendica\Core\Config\Capability\IManageConfigValues; +use Friendica\Test\MemoryCacheTestCase; use Mockery; /** * @requires extension redis * @group REDIS */ -class RedisCacheTest extends MemoryCacheTest +class RedisCacheTest extends MemoryCacheTestCase { protected function getInstance() { @@ -44,7 +45,7 @@ class RedisCacheTest extends MemoryCacheTest ->andReturn(null); try { - $this->cache = new \Friendica\Core\Cache\Type\RedisCache($host, $configMock); + $this->cache = new RedisCache($host, $configMock); } catch (Exception $e) { static::markTestSkipped('Redis is not available. Failure: ' . $e->getMessage()); }