mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-26 12:08:47 +02:00
N°9144 Small fixes
> Prevent verification when some dependencies are missing > Close unclosed div > Change progress bar title depending on step > Fix ignored "check uninstall check" flag > Added phpunit tests to cover "check uninstall check" flag > Progress bar appropriately reflect error status (red & not animated)
This commit is contained in:
@@ -39,6 +39,7 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'uninstallable' => true,
|
||||
],
|
||||
'bCurrentSelected' => false,
|
||||
'bDisableUninstallChecks' => false,
|
||||
'aExpectedFlags' => [
|
||||
'uninstallable' => true,
|
||||
'missing' => false,
|
||||
@@ -59,6 +60,7 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'uninstallable' => true,
|
||||
],
|
||||
'bCurrentSelected' => true,
|
||||
'bDisableUninstallChecks' => false,
|
||||
'aExpectedFlags' => [
|
||||
'uninstallable' => true,
|
||||
'missing' => false,
|
||||
@@ -77,6 +79,7 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'uninstallable' => true,
|
||||
],
|
||||
'bCurrentSelected' => false,
|
||||
'bDisableUninstallChecks' => false,
|
||||
'aExpectedFlags' => [
|
||||
'uninstallable' => true,
|
||||
'missing' => true,
|
||||
@@ -95,6 +98,7 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'uninstallable' => true,
|
||||
],
|
||||
'bCurrentSelected' => false,
|
||||
'bDisableUninstallChecks' => false,
|
||||
'aExpectedFlags' => [
|
||||
'uninstallable' => true,
|
||||
'missing' => true,
|
||||
@@ -113,6 +117,7 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'uninstallable' => false,
|
||||
],
|
||||
'bCurrentSelected' => false,
|
||||
'bDisableUninstallChecks' => false,
|
||||
'aExpectedFlags' => [
|
||||
'uninstallable' => false,
|
||||
'missing' => true,
|
||||
@@ -133,6 +138,7 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'uninstallable' => true,
|
||||
],
|
||||
'bCurrentSelected' => false,
|
||||
'bDisableUninstallChecks' => false,
|
||||
'aExpectedFlags' => [
|
||||
'uninstallable' => true,
|
||||
'missing' => false,
|
||||
@@ -153,6 +159,7 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'uninstallable' => false,
|
||||
],
|
||||
'bCurrentSelected' => false,
|
||||
'bDisableUninstallChecks' => false,
|
||||
'aExpectedFlags' => [
|
||||
'uninstallable' => false,
|
||||
'missing' => false,
|
||||
@@ -161,6 +168,27 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'checked' => true,
|
||||
],
|
||||
],
|
||||
'An installed non uninstallable extension should be enabled if the "disable uninstallation check" flag is set' => [
|
||||
'aExtensionsOnDiskOrDb' => [
|
||||
'itop-ext1' => [
|
||||
'installed' => true,
|
||||
],
|
||||
],
|
||||
'aWizardStepDefinition' => [
|
||||
'extension_code' => 'itop-ext1',
|
||||
'mandatory' => false,
|
||||
'uninstallable' => false,
|
||||
],
|
||||
'bCurrentSelected' => true,
|
||||
'bDisableUninstallChecks' => true,
|
||||
'aExpectedFlags' => [
|
||||
'uninstallable' => false,
|
||||
'missing' => false,
|
||||
'installed' => true,
|
||||
'disabled' => false,
|
||||
'checked' => true,
|
||||
],
|
||||
],
|
||||
'A mandatory extension should be checked and disabled' => [
|
||||
'aExtensionsOnDiskOrDb' => [
|
||||
'itop-ext1' => [
|
||||
@@ -173,6 +201,28 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'uninstallable' => true,
|
||||
],
|
||||
'bCurrentSelected' => false,
|
||||
'bDisableUninstallChecks' => false,
|
||||
'aExpectedFlags' => [
|
||||
'uninstallable' => true,
|
||||
'missing' => false,
|
||||
'installed' => false,
|
||||
'disabled' => true,
|
||||
'checked' => true,
|
||||
],
|
||||
],
|
||||
'A mandatory extension should be checked and disabled even if the "disable uninstallation check" flag is set' => [
|
||||
'aExtensionsOnDiskOrDb' => [
|
||||
'itop-ext1' => [
|
||||
'installed' => false,
|
||||
],
|
||||
],
|
||||
'aWizardStepDefinition' => [
|
||||
'extension_code' => 'itop-ext1',
|
||||
'mandatory' => true,
|
||||
'uninstallable' => true,
|
||||
],
|
||||
'bCurrentSelected' => false,
|
||||
'bDisableUninstallChecks' => true,
|
||||
'aExpectedFlags' => [
|
||||
'uninstallable' => true,
|
||||
'missing' => false,
|
||||
@@ -205,6 +255,7 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
],
|
||||
],
|
||||
'bCurrentSelected' => false,
|
||||
'bDisableUninstallChecks' => false,
|
||||
'aExpectedFlags' => [
|
||||
'uninstallable' => true,
|
||||
'missing' => false,
|
||||
@@ -237,6 +288,7 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
],
|
||||
],
|
||||
'bCurrentSelected' => false,
|
||||
'bDisableUninstallChecks' => false,
|
||||
'aExpectedFlags' => [
|
||||
'uninstallable' => true,
|
||||
'missing' => false,
|
||||
@@ -269,6 +321,7 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
],
|
||||
],
|
||||
'bCurrentSelected' => false,
|
||||
'bDisableUninstallChecks' => false,
|
||||
'aExpectedFlags' => [
|
||||
'uninstallable' => true,
|
||||
'missing' => false,
|
||||
@@ -301,6 +354,7 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
],
|
||||
],
|
||||
'bCurrentSelected' => false,
|
||||
'bDisableUninstallChecks' => false,
|
||||
'aExpectedFlags' => [
|
||||
'uninstallable' => true,
|
||||
'missing' => false,
|
||||
@@ -315,10 +369,10 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
/**
|
||||
* @dataProvider ProviderComputeChoiceFlags
|
||||
*/
|
||||
public function testComputeChoiceFlags($aExtensionsOnDiskOrDb, $aWizardStepDefinition, $bIsCurrentSelected, $aExpectedFlags)
|
||||
public function testComputeChoiceFlags($aExtensionsOnDiskOrDb, $aWizardStepDefinition, $bIsCurrentSelected, $bDisableUninstallChecks, $aExpectedFlags)
|
||||
{
|
||||
$this->oStep->setExtensionMap(iTopExtensionsMapFake::createFromArray($aExtensionsOnDiskOrDb));
|
||||
$aFlags = $this->oStep->ComputeChoiceFlags($aWizardStepDefinition, '_0', $bIsCurrentSelected ? ['_0' => '_0'] : [], false, false, true);
|
||||
$aFlags = $this->oStep->ComputeChoiceFlags($aWizardStepDefinition, '_0', $bIsCurrentSelected ? ['_0' => '_0'] : [], false, $bDisableUninstallChecks, true);
|
||||
$this->assertEquals($aExpectedFlags, $aFlags);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user