]> git.mxchange.org Git - friendica.git/commitdiff
Call the initial value check in the test
authorMichael <heluecht@pirati.ca>
Fri, 15 May 2020 18:08:06 +0000 (18:08 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 15 May 2020 18:08:06 +0000 (18:08 +0000)
src/Database/DBStructure.php
tests/datasets/api.fixture.php
tests/include/ApiTest.php

index 67685de3dc9e736efa55cb7161943c949ce2396f..a02d6cf1b4e3f4452a406d84dbd20e859355e51c 100644 (file)
@@ -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' => '']);
index 23346f7e597b7ad0e06116d8263d589044d9ddfc..8713b1ff36479254260c9addbc77e5dd2ecb9d3a 100644 (file)
@@ -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,
index df2c030877e9c13c5719fc669ffa4ee32b501d23..d6ce7576fee80264b8b8c5bec8059a4e7cf03dc8 100644 (file)
@@ -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);