mirror of
https://github.com/Combodo/iTop.git
synced 2026-09-18 23:49:14 +02:00
Merge branch 'support/3.0' into support/3.1
This commit is contained in:
@@ -21,6 +21,10 @@ class InstallationFileServiceTest extends TestCase {
|
||||
$this->RecurseMoveDir(APPROOT."data/production-modules/$sModuleId", APPROOT . "datamodels/2.x/$sModuleId");
|
||||
}
|
||||
|
||||
private function GetInstallationPath() {
|
||||
return realpath(__DIR__ . '/installation.xml');
|
||||
}
|
||||
|
||||
public function GetDefaultModulesProvider() {
|
||||
return [
|
||||
'all checked' => [ true ],
|
||||
@@ -32,14 +36,11 @@ class InstallationFileServiceTest extends TestCase {
|
||||
* @dataProvider GetDefaultModulesProvider
|
||||
*/
|
||||
public function testProcessInstallationChoices($bInstallationOptionalChoicesChecked=false) {
|
||||
$sPath = realpath(dirname(__FILE__, 6)."/datamodels/2.x/installation.xml");
|
||||
$sPath = realpath($this->GetInstallationPath());
|
||||
$this->assertTrue(is_file($sPath));
|
||||
$oInstallationFileService = new \InstallationFileService($sPath, 'production', [], $bInstallationOptionalChoicesChecked);
|
||||
$oInstallationFileService->ProcessInstallationChoices();
|
||||
$aExpectedModules = [
|
||||
'combodo-backoffice-darkmoon-theme',
|
||||
'itop-structure',
|
||||
'itop-themes-compat',
|
||||
"itop-config-mgmt",
|
||||
"itop-attachments",
|
||||
"itop-profiles-itil",
|
||||
@@ -71,11 +72,9 @@ class InstallationFileServiceTest extends TestCase {
|
||||
if ($bInstallationOptionalChoicesChecked){
|
||||
$aExpectedModules []= "itop-problem-mgmt";
|
||||
$aExpectedModules []= "itop-knownerror-mgmt";
|
||||
$aExpectedModules []= "itop-faq-light";
|
||||
} else {
|
||||
$aExpectedUnselectedModules []= "itop-problem-mgmt";
|
||||
$aExpectedUnselectedModules []= "itop-knownerror-mgmt";
|
||||
$aExpectedUnselectedModules []= "itop-faq-light";
|
||||
}
|
||||
|
||||
sort($aExpectedModules);
|
||||
@@ -94,15 +93,14 @@ class InstallationFileServiceTest extends TestCase {
|
||||
* @dataProvider GetDefaultModulesProvider
|
||||
*/
|
||||
public function testGetAllSelectedModules($bInstallationOptionalChoicesChecked=false) {
|
||||
$sPath = realpath(dirname(__FILE__, 6)."/datamodels/2.x/installation.xml");
|
||||
$sPath = realpath($this->GetInstallationPath());
|
||||
$oInstallationFileService = new \InstallationFileService($sPath, 'production', [], $bInstallationOptionalChoicesChecked);
|
||||
$oInstallationFileService->Init();
|
||||
|
||||
$aSelectedModules = $oInstallationFileService->GetSelectedModules();
|
||||
$aExpectedInstallationModules = [
|
||||
'combodo-backoffice-darkmoon-theme',
|
||||
'itop-structure',
|
||||
'itop-themes-compat',
|
||||
'itop-structure',
|
||||
"itop-config-mgmt",
|
||||
"itop-attachments",
|
||||
"itop-profiles-itil",
|
||||
@@ -126,7 +124,6 @@ class InstallationFileServiceTest extends TestCase {
|
||||
if ($bInstallationOptionalChoicesChecked){
|
||||
$aExpectedInstallationModules []= "itop-problem-mgmt";
|
||||
$aExpectedInstallationModules []= "itop-knownerror-mgmt";
|
||||
$aExpectedInstallationModules []= "itop-faq-light";
|
||||
}
|
||||
|
||||
$aExpectedAuthenticationModules = [
|
||||
@@ -210,15 +207,14 @@ class InstallationFileServiceTest extends TestCase {
|
||||
* @dataProvider ItilExtensionProvider
|
||||
*/
|
||||
public function testGetAllSelectedModules_withItilExtensions(array $aSelectedExtensions, bool $bKnownMgtSelected) {
|
||||
$sPath = realpath(dirname(__FILE__, 6)."/datamodels/2.x/installation.xml");
|
||||
$sPath = realpath($this->GetInstallationPath());
|
||||
$oInstallationFileService = new \InstallationFileService($sPath, 'production', $aSelectedExtensions);
|
||||
$oInstallationFileService->Init();
|
||||
|
||||
$aSelectedModules = $oInstallationFileService->GetSelectedModules();
|
||||
$aExpectedInstallationModules = [
|
||||
'combodo-backoffice-darkmoon-theme',
|
||||
'itop-structure',
|
||||
'itop-themes-compat',
|
||||
'itop-structure',
|
||||
"itop-config-mgmt",
|
||||
"itop-attachments",
|
||||
"itop-profiles-itil",
|
||||
@@ -243,7 +239,6 @@ class InstallationFileServiceTest extends TestCase {
|
||||
];
|
||||
if ($bKnownMgtSelected){
|
||||
$aExpectedInstallationModules []= "itop-knownerror-mgmt";
|
||||
$aExpectedInstallationModules []= "itop-faq-light";
|
||||
}
|
||||
|
||||
$aExpectedAuthenticationModules = [
|
||||
@@ -311,7 +306,7 @@ class InstallationFileServiceTest extends TestCase {
|
||||
$this->RecurseMoveDir(APPROOT . "datamodels/2.x/$sModuleId", APPROOT."data/production-modules/$sModuleId");
|
||||
}
|
||||
|
||||
$sPath = realpath(dirname(__FILE__, 6)."/datamodels/2.x/installation.xml");
|
||||
$sPath = realpath($this->GetInstallationPath());
|
||||
$oInstallationFileService = new \InstallationFileService($sPath, 'production', [], false);
|
||||
$oInstallationFileService->Init();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user