Fix tests

This commit is contained in:
Philipp 2022-07-12 23:30:29 +02:00
parent a910fd8864
commit 41803cb731
No known key found for this signature in database
GPG Key ID: 24A7501396EB5432
3 changed files with 18 additions and 3 deletions

View File

@ -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;

View File

@ -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);
}

View File

@ -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);