1
0
Fork 0

Refactoring Core class structures ...

This commit is contained in:
Philipp Holzer 2021-10-26 21:44:29 +02:00
commit b216317477
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432
130 changed files with 1625 additions and 1397 deletions

View file

@ -21,8 +21,8 @@
namespace Friendica\Test\src\Core\Cache;
use Friendica\Core\Cache\ICache;
use Friendica\Core\Cache\IMemoryCache;
use Friendica\Core\Cache\Capability\ICanCache;
use Friendica\Core\Cache\Capability\ICanCacheInMemory;
use Friendica\Test\MockedTest;
use Friendica\Util\PidFile;
@ -34,12 +34,12 @@ abstract class CacheTest extends MockedTest
protected $startTime = 1417011228;
/**
* @var ICache
* @var ICanCache
*/
protected $instance;
/**
* @var IMemoryCache
* @var \Friendica\Core\Cache\Capability\ICanCacheInMemory
*/
protected $cache;

View file

@ -22,7 +22,7 @@
namespace Friendica\Test\src\Core\Cache;
use Friendica\Core\Cache;
use Friendica\Core\Config\Factory\ConfigFactory;
use Friendica\Core\Config\Factory\Config;
use Friendica\Test\DatabaseTestTrait;
use Friendica\Test\Util\Database\StaticDatabase;
use Friendica\Test\Util\VFSTrait;
@ -53,8 +53,8 @@ class DatabaseCacheTest extends CacheTest
$profiler->shouldReceive('saveTimestamp')->withAnyArgs()->andReturn(true);
// load real config to avoid mocking every config-entry which is related to the Database class
$configFactory = new ConfigFactory();
$loader = (new ConfigFactory())->createConfigFileLoader($this->root->url(), []);
$configFactory = new Config();
$loader = (new Config())->createConfigFileLoader($this->root->url(), []);
$configCache = $configFactory->createCache($loader);
$dba = new StaticDatabase($configCache, $profiler, $logger);

View file

@ -23,7 +23,7 @@ namespace Friendica\Test\src\Core\Cache;
use Exception;
use Friendica\Core\Cache\Type\MemcacheCache;
use Friendica\Core\Config\IConfig;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Mockery;
/**
@ -34,7 +34,7 @@ class MemcacheCacheTest extends MemoryCacheTest
{
protected function getInstance()
{
$configMock = Mockery::mock(IConfig::class);
$configMock = Mockery::mock(IManageConfigValues::class);
$host = $_SERVER['MEMCACHE_HOST'] ?? 'localhost';
$port = $_SERVER['MEMCACHE_PORT'] ?? '11211';

View file

@ -23,7 +23,7 @@ namespace Friendica\Test\src\Core\Cache;
use Exception;
use Friendica\Core\Cache\Type\MemcachedCache;
use Friendica\Core\Config\IConfig;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Mockery;
use Psr\Log\NullLogger;
@ -35,7 +35,7 @@ class MemcachedCacheTest extends MemoryCacheTest
{
protected function getInstance()
{
$configMock = Mockery::mock(IConfig::class);
$configMock = Mockery::mock(IManageConfigValues::class);
$host = $_SERVER['MEMCACHED_HOST'] ?? 'localhost';
$port = $_SERVER['MEMCACHED_PORT'] ?? '11211';

View file

@ -22,12 +22,12 @@
namespace Friendica\Test\src\Core\Cache;
use Exception;
use Friendica\Core\Cache\IMemoryCache;
use Friendica\Core\Cache\Capability\ICanCacheInMemory;
abstract class MemoryCacheTest extends CacheTest
{
/**
* @var IMemoryCache
* @var \Friendica\Core\Cache\Capability\ICanCacheInMemory
*/
protected $instance;
@ -35,7 +35,7 @@ abstract class MemoryCacheTest extends CacheTest
{
parent::setUp();
if (!($this->instance instanceof IMemoryCache)) {
if (!($this->instance instanceof ICanCacheInMemory)) {
throw new Exception('MemoryCacheTest unsupported');
}
}

View file

@ -23,7 +23,7 @@ namespace Friendica\Test\src\Core\Cache;
use Exception;
use Friendica\Core\Cache\Type\RedisCache;
use Friendica\Core\Config\IConfig;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Mockery;
/**
@ -34,7 +34,7 @@ class RedisCacheTest extends MemoryCacheTest
{
protected function getInstance()
{
$configMock = Mockery::mock(IConfig::class);
$configMock = Mockery::mock(IManageConfigValues::class);
$host = $_SERVER['REDIS_HOST'] ?? 'localhost';
$port = $_SERVER['REDIS_PORT'] ?? 6379;