From d70b77288dcb506ea9c4cc0a8306b630e0e21f80 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 15 May 2020 18:08:06 +0000 Subject: [PATCH] Call the initial value check in the test --- src/Database/DBStructure.php | 5 ++++- tests/datasets/api.fixture.php | 9 --------- tests/include/ApiTest.php | 5 +++-- 3 files changed, 7 insertions(+), 12 deletions(-) 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); -- 2.39.5