mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-01 23:24:12 +01:00
module discovery classes renaming to avoid collision with customer DM definitions
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
namespace Combodo\iTop\Test\UnitTest\Setup;
|
||||
|
||||
use Combodo\iTop\Test\UnitTest\ItopTestCase;
|
||||
use ModuleDependency;
|
||||
use iTopCoreModuleDependency;
|
||||
|
||||
class ModuleDependencyTest extends ItopTestCase
|
||||
{
|
||||
@@ -14,13 +14,13 @@ class ModuleDependencyTest extends ItopTestCase
|
||||
|
||||
public function testModuleDependencyInit_Invalid()
|
||||
{
|
||||
$oModuleDependency = new ModuleDependency('||');
|
||||
$oModuleDependency = new iTopCoreModuleDependency('||');
|
||||
$this->assertEquals(true, $this->GetNonPublicProperty($oModuleDependency, 'bAlwaysUnresolved'));
|
||||
}
|
||||
|
||||
public function testModuleDependencyInit()
|
||||
{
|
||||
$oModuleDependency = new ModuleDependency('itop-config-mgmt/2.4.0');
|
||||
$oModuleDependency = new iTopCoreModuleDependency('itop-config-mgmt/2.4.0');
|
||||
$this->assertEquals(['itop-config-mgmt/2.4.0' => [ 'itop-config-mgmt', '>=', '2.4.0']], $this->GetNonPublicProperty($oModuleDependency, 'aParamsPerModuleId'));
|
||||
$this->assertEquals(false, $this->GetNonPublicProperty($oModuleDependency, 'bAlwaysUnresolved'));
|
||||
$this->assertEquals(['itop-config-mgmt'], $oModuleDependency->GetPotentialPrerequisiteModuleNames());
|
||||
@@ -41,7 +41,7 @@ class ModuleDependencyTest extends ItopTestCase
|
||||
public function testModuleDependencyInit_WithOperator($sOperator)
|
||||
{
|
||||
$sDepId = "itop-config-mgmt/{$sOperator}2.4.0";
|
||||
$oModuleDependency = new ModuleDependency($sDepId);
|
||||
$oModuleDependency = new iTopCoreModuleDependency($sDepId);
|
||||
$this->assertEquals([$sDepId => [ 'itop-config-mgmt', $sOperator, '2.4.0']], $this->GetNonPublicProperty($oModuleDependency, 'aParamsPerModuleId'));
|
||||
$this->assertEquals(false, $this->GetNonPublicProperty($oModuleDependency, 'bAlwaysUnresolved'));
|
||||
$this->assertEquals(['itop-config-mgmt'], $oModuleDependency->GetPotentialPrerequisiteModuleNames());
|
||||
@@ -63,7 +63,7 @@ class ModuleDependencyTest extends ItopTestCase
|
||||
public function testModuleDependencyInit_WithOperand($sOperand, $sDepId)
|
||||
{
|
||||
$sDepId = "itop-structure/3.0.0 $sOperand itop-portal/<3.2.1";
|
||||
$oModuleDependency = new ModuleDependency($sDepId);
|
||||
$oModuleDependency = new iTopCoreModuleDependency($sDepId);
|
||||
$this->assertEquals(['itop-structure/3.0.0' => [ 'itop-structure', ">=", '3.0.0'], 'itop-portal/<3.2.1' => [ 'itop-portal', "<", '3.2.1']], $this->GetNonPublicProperty($oModuleDependency, 'aParamsPerModuleId'));
|
||||
$this->assertEquals(false, $this->GetNonPublicProperty($oModuleDependency, 'bAlwaysUnresolved'));
|
||||
$this->assertEquals(['itop-structure', 'itop-portal'], $oModuleDependency->GetPotentialPrerequisiteModuleNames());
|
||||
@@ -71,55 +71,55 @@ class ModuleDependencyTest extends ItopTestCase
|
||||
|
||||
public function testModuleIsDependencyResolved_SimpleCase_UnresolvedDueToMissingModule()
|
||||
{
|
||||
$oModuleDependency = new ModuleDependency('itop-config-mgmt/2.4.0');
|
||||
$oModuleDependency = new iTopCoreModuleDependency('itop-config-mgmt/2.4.0');
|
||||
$this->assertEquals(false, $oModuleDependency->IsDependencyResolved([], ['itop-config-mgmt' => true]));
|
||||
}
|
||||
|
||||
public function testModuleIsDependencyResolved_SimpleCase_UnresolvedDueToWrongModuleVersion()
|
||||
{
|
||||
$oModuleDependency = new ModuleDependency('itop-config-mgmt/2.4.0');
|
||||
$oModuleDependency = new iTopCoreModuleDependency('itop-config-mgmt/2.4.0');
|
||||
$this->assertEquals(false, $oModuleDependency->IsDependencyResolved(['itop-config-mgmt' => '1.2.3'], ['itop-config-mgmt' => true]));
|
||||
}
|
||||
|
||||
public function testModuleIsDependencyResolved_SimpleCase_ResolvedDue_MinorVersion()
|
||||
{
|
||||
$oModuleDependency = new ModuleDependency('itop-config-mgmt/2.4.1');
|
||||
$oModuleDependency = new iTopCoreModuleDependency('itop-config-mgmt/2.4.1');
|
||||
$this->assertEquals(true, $oModuleDependency->IsDependencyResolved(['itop-config-mgmt' => '2.4.1-1'], ['itop-config-mgmt' => true]));
|
||||
}
|
||||
|
||||
public function testModuleIsDependencyResolved_SimpleCase_ResolvedDue_MinorVersion2()
|
||||
{
|
||||
$oModuleDependency = new ModuleDependency('itop-config-mgmt/2.4.1-1');
|
||||
$oModuleDependency = new iTopCoreModuleDependency('itop-config-mgmt/2.4.1-1');
|
||||
$this->assertEquals(true, $oModuleDependency->IsDependencyResolved(['itop-config-mgmt' => '2.4.1-2'], ['itop-config-mgmt' => true]));
|
||||
}
|
||||
|
||||
public function testModuleIsDependencyResolved_SimpleCase_ResolvedDue_MinorVersion3()
|
||||
{
|
||||
$oModuleDependency = new ModuleDependency('itop-config-mgmt/2.4.1-1');
|
||||
$oModuleDependency = new iTopCoreModuleDependency('itop-config-mgmt/2.4.1-1');
|
||||
$this->assertEquals(true, $oModuleDependency->IsDependencyResolved(['itop-config-mgmt' => '2.4.2'], ['itop-config-mgmt' => true]));
|
||||
}
|
||||
|
||||
public function testModuleIsDependencyResolved_SimpleCase_UnresolvedDueToWrongModuleVersion_MinorVersion()
|
||||
{
|
||||
$oModuleDependency = new ModuleDependency('itop-config-mgmt/2.4.1');
|
||||
$oModuleDependency = new iTopCoreModuleDependency('itop-config-mgmt/2.4.1');
|
||||
$this->assertEquals(false, $oModuleDependency->IsDependencyResolved(['itop-config-mgmt' => '2.4.0-1'], ['itop-config-mgmt' => true]));
|
||||
}
|
||||
|
||||
public function testModuleIsDependencyResolved_SimpleCase_UnresolvedDueToWrongModuleVersion_MinorVersion2()
|
||||
{
|
||||
$oModuleDependency = new ModuleDependency('itop-config-mgmt/2.4.1-1');
|
||||
$oModuleDependency = new iTopCoreModuleDependency('itop-config-mgmt/2.4.1-1');
|
||||
$this->assertEquals(false, $oModuleDependency->IsDependencyResolved(['itop-config-mgmt' => '2.4.1'], ['itop-config-mgmt' => true]));
|
||||
}
|
||||
|
||||
public function testModuleIsDependencyResolved_SimpleCase_UnresolvedDueToWrongModuleVersion_MinorVersion3()
|
||||
{
|
||||
$oModuleDependency = new ModuleDependency('itop-config-mgmt/2.4.1-1');
|
||||
$oModuleDependency = new iTopCoreModuleDependency('itop-config-mgmt/2.4.1-1');
|
||||
$this->assertEquals(false, $oModuleDependency->IsDependencyResolved(['itop-config-mgmt' => '2.4.1-0'], ['itop-config-mgmt' => true]));
|
||||
}
|
||||
|
||||
public function testModuleIsDependencyResolved_SimpleCase_Resolved()
|
||||
{
|
||||
$oModuleDependency = new ModuleDependency('itop-config-mgmt/2.4.0');
|
||||
$oModuleDependency = new iTopCoreModuleDependency('itop-config-mgmt/2.4.0');
|
||||
$this->assertEquals(['itop-config-mgmt'], $oModuleDependency->GetPotentialPrerequisiteModuleNames());
|
||||
$this->assertEquals(true, $oModuleDependency->IsDependencyResolved(['itop-config-mgmt' => '2.4.1'], ['itop-config-mgmt' => true]));
|
||||
$this->assertEquals([], $oModuleDependency->GetPotentialPrerequisiteModuleNames());
|
||||
@@ -128,7 +128,7 @@ class ModuleDependencyTest extends ItopTestCase
|
||||
public function testIsDependencyResolved_AndOperand_UnresolvedDueToMissingModule()
|
||||
{
|
||||
$sDepId = "itop-structure/3.0.0 && itop-portal/3.2.1";
|
||||
$oModuleDependency = new ModuleDependency($sDepId);
|
||||
$oModuleDependency = new iTopCoreModuleDependency($sDepId);
|
||||
$this->assertEquals(['itop-structure/3.0.0' => [ 'itop-structure', ">=", '3.0.0'], 'itop-portal/3.2.1' => [ 'itop-portal', ">=", '3.2.1']], $this->GetNonPublicProperty($oModuleDependency, 'aParamsPerModuleId'));
|
||||
$this->assertEquals(false, $this->GetNonPublicProperty($oModuleDependency, 'bAlwaysUnresolved'));
|
||||
$this->assertEquals(['itop-structure', 'itop-portal'], $oModuleDependency->GetPotentialPrerequisiteModuleNames());
|
||||
@@ -140,7 +140,7 @@ class ModuleDependencyTest extends ItopTestCase
|
||||
public function testIsDependencyResolved_AndOperand_UnresolvedDueToWrongModuleVersion()
|
||||
{
|
||||
$sDepId = "itop-structure/3.0.0 && itop-portal/3.2.1";
|
||||
$oModuleDependency = new ModuleDependency($sDepId);
|
||||
$oModuleDependency = new iTopCoreModuleDependency($sDepId);
|
||||
$this->assertEquals(['itop-structure/3.0.0' => [ 'itop-structure', ">=", '3.0.0'], 'itop-portal/3.2.1' => [ 'itop-portal', ">=", '3.2.1']], $this->GetNonPublicProperty($oModuleDependency, 'aParamsPerModuleId'));
|
||||
$this->assertEquals(false, $this->GetNonPublicProperty($oModuleDependency, 'bAlwaysUnresolved'));
|
||||
$this->assertEquals(['itop-structure', 'itop-portal'], $oModuleDependency->GetPotentialPrerequisiteModuleNames());
|
||||
@@ -152,7 +152,7 @@ class ModuleDependencyTest extends ItopTestCase
|
||||
public function testIsDependencyResolved_AndOperand_Resolved()
|
||||
{
|
||||
$sDepId = "itop-structure/3.0.0 && itop-portal/3.2.1";
|
||||
$oModuleDependency = new ModuleDependency($sDepId);
|
||||
$oModuleDependency = new iTopCoreModuleDependency($sDepId);
|
||||
$this->assertEquals(['itop-structure/3.0.0' => [ 'itop-structure', ">=", '3.0.0'], 'itop-portal/3.2.1' => [ 'itop-portal', ">=", '3.2.1']], $this->GetNonPublicProperty($oModuleDependency, 'aParamsPerModuleId'));
|
||||
$this->assertEquals(false, $this->GetNonPublicProperty($oModuleDependency, 'bAlwaysUnresolved'));
|
||||
$this->assertEquals(['itop-structure', 'itop-portal'], $oModuleDependency->GetPotentialPrerequisiteModuleNames());
|
||||
@@ -164,7 +164,7 @@ class ModuleDependencyTest extends ItopTestCase
|
||||
public function testIsDependencyResolved_OrOperand_ResolvedDueToMissingModule()
|
||||
{
|
||||
$sDepId = "itop-structure/3.0.0 || itop-portal/3.2.1";
|
||||
$oModuleDependency = new ModuleDependency($sDepId);
|
||||
$oModuleDependency = new iTopCoreModuleDependency($sDepId);
|
||||
$this->assertEquals(['itop-structure/3.0.0' => [ 'itop-structure', ">=", '3.0.0'], 'itop-portal/3.2.1' => [ 'itop-portal', ">=", '3.2.1']], $this->GetNonPublicProperty($oModuleDependency, 'aParamsPerModuleId'));
|
||||
$this->assertEquals(false, $this->GetNonPublicProperty($oModuleDependency, 'bAlwaysUnresolved'));
|
||||
$this->assertEquals(['itop-structure', 'itop-portal'], $oModuleDependency->GetPotentialPrerequisiteModuleNames());
|
||||
|
||||
Reference in New Issue
Block a user