1
0
Fork 0

Call the initial value check in the test

This commit is contained in:
Michael 2020-05-15 18:08:06 +00:00
parent e333f45d0f
commit d70b77288d
3 changed files with 7 additions and 12 deletions

View file

@ -983,7 +983,10 @@ class DBStructure
return DBA::toArray($stmtColumns); 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])) { if (DBA::tableExists('contact') && !DBA::exists('contact', ['id' => 0])) {
DBA::insert('contact', ['nurl' => '']); DBA::insert('contact', ['nurl' => '']);

View file

@ -57,10 +57,6 @@ return [
], ],
], ],
'contact' => [ 'contact' => [
[
'id' => 0,
'uid' => 0,
],
[ [
'id' => 42, 'id' => 42,
'uid' => 42, 'uid' => 42,
@ -136,11 +132,6 @@ return [
'guid' => '6', 'guid' => '6',
], ],
], ],
'permissionset' => [
[
'id' => 0,
]
],
'item' => [ 'item' => [
[ [
'id' => 1, 'id' => 1,

View file

@ -12,9 +12,8 @@ use Friendica\Core\PConfig\IPConfig;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Core\Session; use Friendica\Core\Session;
use Friendica\Core\Session\ISession; use Friendica\Core\Session\ISession;
use Friendica\Core\System;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Database\DBA; use Friendica\Database\DBStructure;
use Friendica\DI; use Friendica\DI;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Network\HTTPException; use Friendica\Network\HTTPException;
@ -73,6 +72,8 @@ class ApiTest extends DatabaseTest
$dba->setTestmode(true); $dba->setTestmode(true);
DBStructure::checkInitialValues();
/** @var IConfig $config */ /** @var IConfig $config */
$this->config = $this->dice->create(IConfig::class); $this->config = $this->dice->create(IConfig::class);