mirror of
https://github.com/friendica/friendica
synced 2024-11-09 16:22:56 +00:00
Fix tests
This commit is contained in:
parent
a910fd8864
commit
41803cb731
3 changed files with 18 additions and 3 deletions
|
@ -23,6 +23,8 @@ namespace Friendica\Test\src\Core\Cache;
|
|||
|
||||
use Friendica\Core\Cache;
|
||||
use Friendica\Core\Config\Factory\Config;
|
||||
use Friendica\Database\Definition\DbaDefinition;
|
||||
use Friendica\Database\Definition\ViewDefinition;
|
||||
use Friendica\Test\DatabaseTestTrait;
|
||||
use Friendica\Test\Util\Database\StaticDatabase;
|
||||
use Friendica\Test\Util\VFSTrait;
|
||||
|
@ -57,7 +59,10 @@ class DatabaseCacheTest extends CacheTest
|
|||
$loader = (new Config())->createConfigFileLoader($this->root->url(), []);
|
||||
$configCache = $configFactory->createCache($loader);
|
||||
|
||||
$dba = new StaticDatabase($configCache, $profiler, $logger);
|
||||
$dbaDefinition = (new DbaDefinition($configCache->get('system', 'basepath')))->load();
|
||||
$viewDefinition = (new ViewDefinition($configCache->get('system', 'basepath')))->load();
|
||||
|
||||
$dba = new StaticDatabase($configCache, $profiler, $dbaDefinition, $viewDefinition, $logger);
|
||||
|
||||
$this->cache = new Cache\Type\DatabaseCache('database', $dba);
|
||||
return $this->cache;
|
||||
|
|
|
@ -23,6 +23,8 @@ namespace Friendica\Test\src\Core\Storage;
|
|||
|
||||
use Friendica\Core\Config\Factory\Config;
|
||||
use Friendica\Core\Storage\Type\Database;
|
||||
use Friendica\Database\Definition\DbaDefinition;
|
||||
use Friendica\Database\Definition\ViewDefinition;
|
||||
use Friendica\Test\DatabaseTestTrait;
|
||||
use Friendica\Test\Util\Database\StaticDatabase;
|
||||
use Friendica\Test\Util\VFSTrait;
|
||||
|
@ -56,7 +58,10 @@ class DatabaseStorageTest extends StorageTest
|
|||
$loader = (new Config())->createConfigFileLoader($this->root->url(), []);
|
||||
$configCache = $configFactory->createCache($loader);
|
||||
|
||||
$dba = new StaticDatabase($configCache, $profiler, $logger);
|
||||
$dbaDefinition = (new DbaDefinition($configCache->get('system', 'basepath')))->load();
|
||||
$viewDefinition = (new ViewDefinition($configCache->get('system', 'basepath')))->load();
|
||||
|
||||
$dba = new StaticDatabase($configCache, $profiler, $dbaDefinition, $viewDefinition, $logger);
|
||||
|
||||
return new Database($dba);
|
||||
}
|
||||
|
|
|
@ -37,6 +37,8 @@ use Friendica\Core\Storage\Repository\StorageManager;
|
|||
use Friendica\Core\Storage\Type\Filesystem;
|
||||
use Friendica\Core\Storage\Type\SystemResource;
|
||||
use Friendica\Database\Database;
|
||||
use Friendica\Database\Definition\DbaDefinition;
|
||||
use Friendica\Database\Definition\ViewDefinition;
|
||||
use Friendica\DI;
|
||||
use Friendica\Core\Config\Factory\Config;
|
||||
use Friendica\Core\Config\Repository;
|
||||
|
@ -82,7 +84,10 @@ class StorageManagerTest extends DatabaseTest
|
|||
$loader = $configFactory->createConfigFileLoader($this->root->url(), []);
|
||||
$configCache = $configFactory->createCache($loader);
|
||||
|
||||
$this->dba = new StaticDatabase($configCache, $profiler, $this->logger);
|
||||
$dbaDefinition = (new DbaDefinition($configCache->get('system', 'basepath')))->load();
|
||||
$viewDefinition = (new ViewDefinition($configCache->get('system', 'basepath')))->load();
|
||||
|
||||
$this->dba = new StaticDatabase($configCache, $profiler, $dbaDefinition, $viewDefinition, $this->logger);
|
||||
|
||||
$configModel = new Repository\Config($this->dba, new Mode(Mode::DBCONFIGAVAILABLE));
|
||||
$this->config = new PreloadConfig($configCache, $configModel);
|
||||
|
|
Loading…
Reference in a new issue