]> git.mxchange.org Git - friendica.git/blobdiff - tests/src/Database/DBATest.php
Merge pull request #8261 from MrPetovan/task/8251-use-about-for-pdesc
[friendica.git] / tests / src / Database / DBATest.php
index d6f59542f6978fb422e0f6a765ba2d8bce8a99b7..aea03e76a2450992a5f328dd98d48d9774431c40 100644 (file)
@@ -2,10 +2,11 @@
 namespace Friendica\Test\src\Database;
 
 use Dice\Dice;
-use Friendica\BaseObject;
-use Friendica\Core\Config;
+use Friendica\Database\Database;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Test\DatabaseTest;
+use Friendica\Test\Util\Database\StaticDatabase;
 
 class DBATest extends DatabaseTest
 {
@@ -13,16 +14,17 @@ class DBATest extends DatabaseTest
        {
                parent::setUp();
 
-               $dice = new Dice();
-               $dice = $dice->addRules(include __DIR__ . '/../../../static/dependencies.config.php');
-               BaseObject::setDependencyInjection($dice);
+               $dice = (new Dice())
+                       ->addRules(include __DIR__ . '/../../../static/dependencies.config.php')
+                       ->addRule(Database::class, ['instanceOf' => StaticDatabase::class, 'shared' => true]);
+               DI::init($dice);
 
                // Default config
-               Config::set('config', 'hostname', 'localhost');
-               Config::set('system', 'throttle_limit_day', 100);
-               Config::set('system', 'throttle_limit_week', 100);
-               Config::set('system', 'throttle_limit_month', 100);
-               Config::set('system', 'theme', 'system_theme');
+               DI::config()->set('config', 'hostname', 'localhost');
+               DI::config()->set('system', 'throttle_limit_day', 100);
+               DI::config()->set('system', 'throttle_limit_week', 100);
+               DI::config()->set('system', 'throttle_limit_month', 100);
+               DI::config()->set('system', 'theme', 'system_theme');
        }
 
        /**