From 8919184ef9ad513e40c00bda9380337a9ffe874d Mon Sep 17 00:00:00 2001 From: odain Date: Fri, 5 Dec 2025 11:36:19 +0100 Subject: [PATCH] ci: adapt test to run also with itop packages --- .../setup/AnalyzeInstallationTest.php | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tests/php-unit-tests/unitary-tests/setup/AnalyzeInstallationTest.php b/tests/php-unit-tests/unitary-tests/setup/AnalyzeInstallationTest.php index e8235bbee..f3155ed3e 100644 --- a/tests/php-unit-tests/unitary-tests/setup/AnalyzeInstallationTest.php +++ b/tests/php-unit-tests/unitary-tests/setup/AnalyzeInstallationTest.php @@ -38,8 +38,8 @@ class AnalyzeInstallationTest extends ItopTestCase 'expected' => [ '_Root_' => [ 'installed_version' => '', - 'available_version' => '3.3.0-dev-svn', - 'name_code' => 'iTop', + 'available_version' => 'ITOP_VERSION_FULL', + 'name_code' => 'ITOP_APPLICATION', ], 'mandatory_module' => [ "mandatory" => true, @@ -77,9 +77,9 @@ class AnalyzeInstallationTest extends ItopTestCase 'aInstalledModules' => json_decode(file_get_contents(__DIR__.'/ressources/priv_modules_simpleusecase.json'), true), 'expected' => [ '_Root_' => [ - 'installed_version' => '3.3.0-dev-svn', - 'available_version' => '3.3.0-dev-svn', - 'name_code' => 'iTop', + 'installed_version' => 'ITOP_VERSION_FULL', + 'available_version' => 'ITOP_VERSION_FULL', + 'name_code' => 'ITOP_APPLICATION', ], 'mandatory_module' => [ "mandatory" => true, @@ -117,8 +117,8 @@ class AnalyzeInstallationTest extends ItopTestCase 'expected' => [ '_Root_' => [ 'installed_version' => '', - 'available_version' => '3.3.0-dev-svn', - 'name_code' => 'iTop', + 'available_version' => 'ITOP_VERSION_FULL', + 'name_code' => 'ITOP_APPLICATION', ], ], ], @@ -127,9 +127,9 @@ class AnalyzeInstallationTest extends ItopTestCase 'aInstalledModules' => json_decode(file_get_contents(__DIR__.'/ressources/priv_modules2.json'), true), 'expected' => [ '_Root_' => [ - 'installed_version' => '3.3.0-dev-svn', - 'available_version' => '3.3.0-dev-svn', - 'name_code' => 'iTop', + 'installed_version' => 'ITOP_VERSION_FULL', + 'available_version' => 'ITOP_VERSION_FULL', + 'name_code' => 'ITOP_APPLICATION', ], ], ], @@ -146,6 +146,9 @@ class AnalyzeInstallationTest extends ItopTestCase */ public function testAnalyzeInstallation($aAvailableModules, $aInstalledModules, $expected) { + $sContent = str_replace(['ITOP_VERSION_FULL', 'ITOP_APPLICATION'], [ITOP_VERSION_FULL, ITOP_APPLICATION], json_encode($expected)); + $expected = json_decode($sContent, true); + $this->SetNonPublicProperty(AnalyzeInstallation::GetInstance(), "aAvailableModules", $aAvailableModules); //$aModules = json_decode(file_get_contents(__DIR__.'/ressources/priv_modules2.json'), true); $this->SetNonPublicProperty(ModuleInstallationService::GetInstance(), "aSelectInstall", $aInstalledModules);