Refactoring Core class structures ...
This commit is contained in:
parent
57b4c008cb
commit
b216317477
130 changed files with 1625 additions and 1397 deletions
|
@ -22,7 +22,7 @@
|
|||
namespace Friendica\Test\src\Core\Lock;
|
||||
|
||||
use Friendica\Core\Lock\Type\DatabaseLock;
|
||||
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;
|
||||
|
@ -55,8 +55,8 @@ class DatabaseLockDriverTest extends LockTest
|
|||
$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);
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
namespace Friendica\Test\src\Core\Lock;
|
||||
|
||||
use Friendica\Core\Lock\ILock;
|
||||
use Friendica\Core\Lock\Capability\ICanLock;
|
||||
use Friendica\Test\MockedTest;
|
||||
|
||||
abstract class LockTest extends MockedTest
|
||||
|
@ -32,7 +32,7 @@ abstract class LockTest extends MockedTest
|
|||
protected $startTime = 1417011228;
|
||||
|
||||
/**
|
||||
* @var ILock
|
||||
* @var ICanLock
|
||||
*/
|
||||
protected $instance;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace Friendica\Test\src\Core\Lock;
|
|||
|
||||
use Exception;
|
||||
use Friendica\Core\Cache\Type\MemcacheCache;
|
||||
use Friendica\Core\Config\IConfig;
|
||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||
use Friendica\Core\Lock\Type\CacheLock;
|
||||
use Mockery;
|
||||
|
||||
|
@ -35,7 +35,7 @@ class MemcacheCacheLockTest extends LockTest
|
|||
{
|
||||
protected function getInstance()
|
||||
{
|
||||
$configMock = Mockery::mock(IConfig::class);
|
||||
$configMock = Mockery::mock(IManageConfigValues::class);
|
||||
|
||||
$host = $_SERVER['MEMCACHE_HOST'] ?? 'localhost';
|
||||
$port = $_SERVER['MEMCACHE_PORT'] ?? '11211';
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace Friendica\Test\src\Core\Lock;
|
|||
|
||||
use Exception;
|
||||
use Friendica\Core\Cache\Type\MemcachedCache;
|
||||
use Friendica\Core\Config\IConfig;
|
||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||
use Friendica\Core\Lock\Type\CacheLock;
|
||||
use Mockery;
|
||||
use Psr\Log\NullLogger;
|
||||
|
@ -36,7 +36,7 @@ class MemcachedCacheLockTest extends LockTest
|
|||
{
|
||||
protected function getInstance()
|
||||
{
|
||||
$configMock = Mockery::mock(IConfig::class);
|
||||
$configMock = Mockery::mock(IManageConfigValues::class);
|
||||
|
||||
$host = $_SERVER['MEMCACHED_HOST'] ?? 'localhost';
|
||||
$port = $_SERVER['MEMCACHED_PORT'] ?? '11211';
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace Friendica\Test\src\Core\Lock;
|
|||
|
||||
use Exception;
|
||||
use Friendica\Core\Cache\Type\RedisCache;
|
||||
use Friendica\Core\Config\IConfig;
|
||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||
use Friendica\Core\Lock\Type\CacheLock;
|
||||
use Mockery;
|
||||
|
||||
|
@ -35,7 +35,7 @@ class RedisCacheLockTest extends LockTest
|
|||
{
|
||||
protected function getInstance()
|
||||
{
|
||||
$configMock = Mockery::mock(IConfig::class);
|
||||
$configMock = Mockery::mock(IManageConfigValues::class);
|
||||
|
||||
$host = $_SERVER['REDIS_HOST'] ?? 'localhost';
|
||||
$port = $_SERVER['REDIS_PORT'] ?? 6379;
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace Friendica\Test\src\Core\Lock;
|
|||
|
||||
use Dice\Dice;
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config\IConfig;
|
||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||
use Friendica\Core\Config\Type\JitConfig;
|
||||
use Friendica\Core\Lock\Type\SemaphoreLock;
|
||||
use Friendica\DI;
|
||||
|
@ -46,7 +46,7 @@ class SemaphoreLockTest extends LockTest
|
|||
->shouldReceive('get')
|
||||
->with('system', 'temppath')
|
||||
->andReturn('/tmp/');
|
||||
$dice->shouldReceive('create')->with(IConfig::class)->andReturn($configMock);
|
||||
$dice->shouldReceive('create')->with(IManageConfigValues::class)->andReturn($configMock);
|
||||
|
||||
// @todo Because "get_temppath()" is using static methods, we have to initialize the BaseObject
|
||||
DI::init($dice);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue