]> git.mxchange.org Git - friendica.git/commitdiff
Fix tests
authorPhilipp <admin@philipp.info>
Tue, 12 Jul 2022 21:30:29 +0000 (23:30 +0200)
committerPhilipp <admin@philipp.info>
Tue, 12 Jul 2022 21:40:31 +0000 (23:40 +0200)
tests/src/Core/Cache/DatabaseCacheTest.php
tests/src/Core/Storage/DatabaseStorageTest.php
tests/src/Core/Storage/Repository/StorageManagerTest.php

index b8d49aa0cce238f96eb330b7173bfd880626a37b..71b488bcb1745b4291785917c825d3046ce8bb14 100644 (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;
index 8f8dc8bf1c2a01659b68d2eea0f70bed28a905e1..75bbc4239bd807c683ac93e85cdc65c449721fb9 100644 (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);
        }
index cce12b790a24353c5a193ba06ab45ddc5a654c31..99dee27a63d551b97e659e051204f60e83ae7591 100644 (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);