mirror of
https://github.com/Combodo/iTop.git
synced 2026-06-09 01:22:28 +02:00
N°9179 Fix tests for unattended install backward compatibility
This commit is contained in:
@@ -439,6 +439,27 @@ class ApplicationInstallerSequencerTest extends ItopTestCase
|
||||
$this->assertEquals($expected, $this->oSequencer->GetStepNames());
|
||||
}
|
||||
|
||||
public function testDefaultOptionalStepsWhenUsingOldParameters()
|
||||
{
|
||||
$aAdditionalParams = [
|
||||
'optional_steps' => null,
|
||||
];
|
||||
$this->GivenApplicationInstallSequencer($aAdditionalParams, true);
|
||||
|
||||
$expected = [
|
||||
'',
|
||||
'log-parameters',
|
||||
'migrate-before',
|
||||
'db-schema',
|
||||
'migrate-after',
|
||||
'after-db-create',
|
||||
'load-data',
|
||||
'create-config',
|
||||
'commit',
|
||||
];
|
||||
$this->assertEquals($expected, $this->oSequencer->GetStepNames());
|
||||
}
|
||||
|
||||
public static function WithoutOneStepProvider()
|
||||
{
|
||||
return [
|
||||
@@ -482,13 +503,13 @@ class ApplicationInstallerSequencerTest extends ItopTestCase
|
||||
|
||||
public function testGetStepNamesWithOnlyMandatorySteps()
|
||||
{
|
||||
$this->GivenApplicationInstallSequencer([], true);
|
||||
$aAdditionalParams = [
|
||||
'optional_steps' => [],
|
||||
];
|
||||
$this->GivenApplicationInstallSequencer($aAdditionalParams, true);
|
||||
$expected = [
|
||||
'',
|
||||
'log-parameters',
|
||||
'migrate-before',
|
||||
'db-schema',
|
||||
'migrate-after',
|
||||
'after-db-create',
|
||||
'load-data',
|
||||
'create-config',
|
||||
|
||||
@@ -290,6 +290,22 @@ class DataAuditSequencerTest extends ItopTestCase
|
||||
$this->assertEquals($expected, $oSequencer->GetStepNames());
|
||||
}
|
||||
|
||||
public function testDefaultOptionalStepsWhenUsingOldParameters()
|
||||
{
|
||||
$oRunTimeEnvironment = $this->createMock(\RunTimeEnvironment::class);
|
||||
$oParams = $this->GivenParams();
|
||||
$oParams->Set('optional_steps', null);
|
||||
$oSequencer = new DataAuditSequencer($oParams, $oRunTimeEnvironment);
|
||||
|
||||
$expected = [
|
||||
'',
|
||||
'copy',
|
||||
'compile',
|
||||
'complete',
|
||||
];
|
||||
$this->assertEquals($expected, $oSequencer->GetStepNames());
|
||||
}
|
||||
|
||||
private function GivenParams(array $aAdditionalParams = []): PHPParameters
|
||||
{
|
||||
$oParams = new PHPParameters();
|
||||
|
||||
Reference in New Issue
Block a user