From 7ced40493534b0995ca9c41d38478cf953a9b03b Mon Sep 17 00:00:00 2001 From: odain Date: Mon, 11 May 2026 17:00:26 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B09567=20-=20fix=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unitary-tests/setup/ExtensionsMapTest.php | 6 +++++- .../setup/ressources/all_extensions_from_datamodels.json | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/php-unit-tests/unitary-tests/setup/ExtensionsMapTest.php b/tests/php-unit-tests/unitary-tests/setup/ExtensionsMapTest.php index 4e56e320e3..e7afc8c512 100644 --- a/tests/php-unit-tests/unitary-tests/setup/ExtensionsMapTest.php +++ b/tests/php-unit-tests/unitary-tests/setup/ExtensionsMapTest.php @@ -159,7 +159,11 @@ class ExtensionsMapTest extends ItopTestCase $sExpected = file_get_contents(__DIR__.'/ressources/all_extensions_from_datamodels.json'); $sExpected = str_replace('"sVersion": "ITOP_VERSION"', '"sVersion": "'.ITOP_VERSION.'"', $sExpected); - $this->assertEquals($sExpected, json_encode($this->SerializeExtensionMap($oiTopExtensionsMap), JSON_PRETTY_PRINT)); + $sExpected = preg_replace('/"module_file_path": .*/', '"module_file_path": ANYPATH', $sExpected); + + $actual = json_encode($this->SerializeExtensionMap($oiTopExtensionsMap), JSON_PRETTY_PRINT); + $actual = preg_replace('/"module_file_path": .*/', '"module_file_path": ANYPATH', $actual); + $this->assertEquals($sExpected, $actual); } public function SerializeExtensionMap(iTopExtensionsMap $oiTopExtensionsMap): array diff --git a/tests/php-unit-tests/unitary-tests/setup/ressources/all_extensions_from_datamodels.json b/tests/php-unit-tests/unitary-tests/setup/ressources/all_extensions_from_datamodels.json index 47d4852b1e..68531962d5 100644 --- a/tests/php-unit-tests/unitary-tests/setup/ressources/all_extensions_from_datamodels.json +++ b/tests/php-unit-tests/unitary-tests/setup/ressources/all_extensions_from_datamodels.json @@ -54,7 +54,7 @@ "doc.manual_setup": "", "doc.more_information": "", "settings": [], - "module_file_path": "\/var\/www\/html\/iTopLegacy\/tests\/php-unit-tests\/unitary-tests\/setup\/ressources\/datamodels\/2.x\/itop-structure\/module.itop-structure.php" + "module_file_path": "APPROOTtests\/php-unit-tests\/unitary-tests\/setup\/ressources\/datamodels\/2.x\/itop-structure\/module.itop-structure.php" }, "itop-config-mgmt": { "label": "Configuration Management (CMDB)", @@ -91,7 +91,7 @@ "doc.manual_setup": "", "doc.more_information": "", "settings": [], - "module_file_path": "\/var\/www\/html\/iTopLegacy\/tests\/php-unit-tests\/unitary-tests\/setup\/ressources\/datamodels\/2.x\/itop-config-mgmt\/module.itop-config-mgmt.php" + "module_file_path": "APPROOT\/tests\/php-unit-tests\/unitary-tests\/setup\/ressources\/datamodels\/2.x\/itop-config-mgmt\/module.itop-config-mgmt.php" } } }, @@ -182,7 +182,7 @@ "doc.manual_setup": "", "doc.more_information": "", "settings": [], - "module_file_path": "\/var\/www\/html\/iTopLegacy\/tests\/php-unit-tests\/unitary-tests\/setup\/ressources\/datamodels\/2.x\/itop-service-mgmt\/module.itop-service-mgmt.php" + "module_file_path": "APPROOT\/tests\/php-unit-tests\/unitary-tests\/setup\/ressources\/datamodels\/2.x\/itop-service-mgmt\/module.itop-service-mgmt.php" } } },