From: Michael Date: Fri, 15 May 2020 18:08:06 +0000 (+0000) Subject: Call the initial value check in the test X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d70b77288dcb506ea9c4cc0a8306b630e0e21f80;p=friendica.git Call the initial value check in the test --- diff --git a/src/Database/DBStructure.php b/src/Database/DBStructure.php index 67685de3dc..a02d6cf1b4 100644 --- a/src/Database/DBStructure.php +++ b/src/Database/DBStructure.php @@ -983,7 +983,10 @@ class DBStructure return DBA::toArray($stmtColumns); } - private static function checkInitialValues() + /** + * Check if initial database values do exist - or create them + */ + public static function checkInitialValues() { if (DBA::tableExists('contact') && !DBA::exists('contact', ['id' => 0])) { DBA::insert('contact', ['nurl' => '']); diff --git a/tests/datasets/api.fixture.php b/tests/datasets/api.fixture.php index 23346f7e59..8713b1ff36 100644 --- a/tests/datasets/api.fixture.php +++ b/tests/datasets/api.fixture.php @@ -57,10 +57,6 @@ return [ ], ], 'contact' => [ - [ - 'id' => 0, - 'uid' => 0, - ], [ 'id' => 42, 'uid' => 42, @@ -136,11 +132,6 @@ return [ 'guid' => '6', ], ], - 'permissionset' => [ - [ - 'id' => 0, - ] - ], 'item' => [ [ 'id' => 1, diff --git a/tests/include/ApiTest.php b/tests/include/ApiTest.php index df2c030877..d6ce7576fe 100644 --- a/tests/include/ApiTest.php +++ b/tests/include/ApiTest.php @@ -12,9 +12,8 @@ use Friendica\Core\PConfig\IPConfig; use Friendica\Core\Protocol; use Friendica\Core\Session; use Friendica\Core\Session\ISession; -use Friendica\Core\System; use Friendica\Database\Database; -use Friendica\Database\DBA; +use Friendica\Database\DBStructure; use Friendica\DI; use Friendica\Model\Contact; use Friendica\Network\HTTPException; @@ -73,6 +72,8 @@ class ApiTest extends DatabaseTest $dba->setTestmode(true); + DBStructure::checkInitialValues(); + /** @var IConfig $config */ $this->config = $this->dice->create(IConfig::class);