From 5efe294895ea048c0576e63d0eccb8dc9a7e578d Mon Sep 17 00:00:00 2001 From: Molkobain Date: Thu, 11 Apr 2024 16:50:27 +0200 Subject: [PATCH 1/2] =?UTF-8?q?N=C2=B07446=20-=20Fix=20custom=20datamodel?= =?UTF-8?q?=20test=20class=20not=20creating=20DB=20tables=20correctly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/BaseTestCase/ItopCustomDatamodelTestCase.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/php-unit-tests/src/BaseTestCase/ItopCustomDatamodelTestCase.php b/tests/php-unit-tests/src/BaseTestCase/ItopCustomDatamodelTestCase.php index 7ef5b612f..98d2b7141 100644 --- a/tests/php-unit-tests/src/BaseTestCase/ItopCustomDatamodelTestCase.php +++ b/tests/php-unit-tests/src/BaseTestCase/ItopCustomDatamodelTestCase.php @@ -190,6 +190,7 @@ abstract class ItopCustomDatamodelTestCase extends ItopDataTestCase } CMDBSource::CreateDB($oTestConfig->Get('db_name')); MetaModel::Startup($sConfFile, false /* $bModelOnly */, true /* $bAllowCache */, false /* $bTraceSourceFiles */, $sTestEnv); + MetaModel::DBCreate(); $this->MarkEnvironmentReady(); $this->debug('Preparation of custom environment "'.$sTestEnv.'" done.'); From ca356859a318263b9af01988e8097f7c8d735ae1 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Thu, 11 Apr 2024 16:55:48 +0200 Subject: [PATCH 2/2] =?UTF-8?q?N=C2=B07446=20-=20Add=20comment=20for=20bet?= =?UTF-8?q?ter=20understanding?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/BaseTestCase/ItopCustomDatamodelTestCase.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/php-unit-tests/src/BaseTestCase/ItopCustomDatamodelTestCase.php b/tests/php-unit-tests/src/BaseTestCase/ItopCustomDatamodelTestCase.php index 98d2b7141..da53441af 100644 --- a/tests/php-unit-tests/src/BaseTestCase/ItopCustomDatamodelTestCase.php +++ b/tests/php-unit-tests/src/BaseTestCase/ItopCustomDatamodelTestCase.php @@ -190,6 +190,7 @@ abstract class ItopCustomDatamodelTestCase extends ItopDataTestCase } CMDBSource::CreateDB($oTestConfig->Get('db_name')); MetaModel::Startup($sConfFile, false /* $bModelOnly */, true /* $bAllowCache */, false /* $bTraceSourceFiles */, $sTestEnv); + // N°7446 For some reason we need to create the DB schema before starting the MM, then only we can create the tables. MetaModel::DBCreate(); $this->MarkEnvironmentReady();