Merge branch 'support/3.2' into develop

This commit is contained in:
odain
2025-11-07 20:33:14 +01:00
1837 changed files with 33034 additions and 34549 deletions

View File

@@ -1,4 +1,5 @@
<?php
// Copyright (c) 2010-2024 Combodo SAS
//
// This file is part of iTop.
@@ -25,7 +26,6 @@ use MetaModel;
use Organization;
use UserRights;
/**
* @group itopVirtualizationMgmt
* @group itopConfigMgmt
@@ -33,7 +33,7 @@ use UserRights;
*/
class UpdateImpactedItemsTest extends ItopDataTestCase
{
const CREATE_TEST_ORG = true;
public const CREATE_TEST_ORG = true;
/**
* @var Object Names to Ids
*/
@@ -63,7 +63,7 @@ class UpdateImpactedItemsTest extends ItopDataTestCase
Server_1 <-> Person_1
EOF);
$oTicket = $this->GivenTicketWithCIsOrPersons([
'Server_1' => 'manual'
'Server_1' => 'manual',
]);
$oTicket->UpdateImpactedItems(); // impact analysis
@@ -71,7 +71,7 @@ class UpdateImpactedItemsTest extends ItopDataTestCase
$this->assertCIsOrPersonsListEquals($oTicket, [
'Server_1' => 'manual',
'Hypervisor_1' => 'computed',
'Test Person_1' => 'computed'
'Test Person_1' => 'computed',
]);
}
@@ -86,7 +86,7 @@ class UpdateImpactedItemsTest extends ItopDataTestCase
Hypervisor_1 -> Server_1
EOF);
$oTicket = $this->GivenTicketWithCIsOrPersons([
'Hypervisor_1' => 'manual'
'Hypervisor_1' => 'manual',
]);
$oTicket->UpdateImpactedItems(); // impact analysis
@@ -106,7 +106,7 @@ class UpdateImpactedItemsTest extends ItopDataTestCase
Farm_1 <-> Person_1
EOF);
$oTicket = $this->GivenTicketWithCIsOrPersons([
'Server_1' => 'manual'
'Server_1' => 'manual',
]);
$oTicket->UpdateImpactedItems(); // impact analysis
@@ -115,7 +115,7 @@ class UpdateImpactedItemsTest extends ItopDataTestCase
'Server_1' => 'manual',
'Hypervisor_1' => 'computed',
'Farm_1' => 'computed',
'Test Person_1' => 'computed'
'Test Person_1' => 'computed',
]);
}
@@ -171,7 +171,7 @@ class UpdateImpactedItemsTest extends ItopDataTestCase
EOF);
$this->GivenCINotAllowedToCurrentUser('Hypervisor_1');
$oTicket = $this->GivenTicketWithCIsOrPersons([
'Server_1' => 'manual'
'Server_1' => 'manual',
]);
MetaModel::GetConfig()->Set('relations.complete_analysis', false);
@@ -193,7 +193,7 @@ class UpdateImpactedItemsTest extends ItopDataTestCase
EOF);
$this->GivenCINotAllowedToCurrentUser('Hypervisor_1');
$oTicket = $this->GivenTicketWithCIsOrPersons([
'Server_1' => 'manual'
'Server_1' => 'manual',
]);
MetaModel::GetConfig()->Set('relations.complete_analysis', true);
@@ -254,7 +254,7 @@ class UpdateImpactedItemsTest extends ItopDataTestCase
'Hypervisor_1' => 'manual',
'Hypervisor_2' => 'manual',
'Farm_1' => 'computed',
'Test Person_1' => 'computed'
'Test Person_1' => 'computed',
]);
}
public function testPreviouslyComputedNodesShouldBeIgnored()
@@ -272,7 +272,7 @@ class UpdateImpactedItemsTest extends ItopDataTestCase
$oTicket = $this->GivenTicketWithCIsOrPersons([
'Server_1' => 'manual',
'Server_2' => 'computed',
'Person_2' => 'computed'
'Person_2' => 'computed',
]);
$oTicket->UpdateImpactedItems(); // impact analysis
@@ -280,7 +280,7 @@ class UpdateImpactedItemsTest extends ItopDataTestCase
$this->assertCIsOrPersonsListEquals($oTicket, [
'Server_1' => 'manual',
'Hypervisor_1' => 'computed',
'Test Person_1' => 'computed'
'Test Person_1' => 'computed',
]);
}
@@ -295,7 +295,7 @@ class UpdateImpactedItemsTest extends ItopDataTestCase
EOF);
$oTicket = $this->GivenTicketWithCIsOrPersons([
'Hypervisor_1' => 'computed',
'Person_1' => 'computed'
'Person_1' => 'computed',
]);
$oTicket->UpdateImpactedItems(); // impact analysis
@@ -303,7 +303,6 @@ class UpdateImpactedItemsTest extends ItopDataTestCase
$this->assertCIsOrPersonsListEquals($oTicket, []);
}
public function testNoImpactWhenNoCI()
{
$oTicket = $this->GivenTicketWithCIsOrPersons([]);
@@ -325,13 +324,13 @@ class UpdateImpactedItemsTest extends ItopDataTestCase
Hypervisor_2 -> Farm_1
DOT);
$oTicket = $this->GivenTicketWithCIsOrPersons([
'Hypervisor_1' => 'manual'
'Hypervisor_1' => 'manual',
]);
$oTicket->UpdateImpactedItems(); // impact analysis
$this->assertCIsOrPersonsListEquals($oTicket, [
'Hypervisor_1' => 'manual'
'Hypervisor_1' => 'manual',
]);
}
@@ -348,7 +347,7 @@ class UpdateImpactedItemsTest extends ItopDataTestCase
DOT);
$oTicket = $this->GivenTicketWithCIsOrPersons([
'Hypervisor_1' => 'manual',
'Hypervisor_2' => 'manual'
'Hypervisor_2' => 'manual',
]);
$oTicket->UpdateImpactedItems(); // impact analysis
@@ -356,7 +355,7 @@ class UpdateImpactedItemsTest extends ItopDataTestCase
$this->assertCIsOrPersonsListEquals($oTicket, [
'Hypervisor_1' => 'manual',
'Hypervisor_2' => 'manual',
'Farm_1' => 'computed'
'Farm_1' => 'computed',
]);
}
@@ -373,7 +372,7 @@ class UpdateImpactedItemsTest extends ItopDataTestCase
$oTicket = $this->GivenTicketWithCIsOrPersons([
'Server_1' => 'manual',
'Hypervisor_1' => 'not_impacted',
'Person_1' => 'do_not_notify'
'Person_1' => 'do_not_notify',
]);
$oTicket->UpdateImpactedItems(); // impact analysis
@@ -381,7 +380,7 @@ class UpdateImpactedItemsTest extends ItopDataTestCase
$this->assertCIsOrPersonsListEquals($oTicket, [
'Server_1' => 'manual',
'Hypervisor_1' => 'not_impacted',
'Test Person_1' => 'do_not_notify'
'Test Person_1' => 'do_not_notify',
]);
}
@@ -395,14 +394,14 @@ class UpdateImpactedItemsTest extends ItopDataTestCase
DOT);
$oTicket = $this->GivenTicketWithCIsOrPersons([
'Hypervisor_1' => 'not_impacted',
'Person_1' => 'do_not_notify'
'Person_1' => 'do_not_notify',
]);
$oTicket->UpdateImpactedItems(); // impact analysis
$this->assertCIsOrPersonsListEquals($oTicket, [
'Hypervisor_1' => 'not_impacted',
'Test Person_1' => 'do_not_notify'
'Test Person_1' => 'do_not_notify',
]);
}
@@ -459,7 +458,6 @@ class UpdateImpactedItemsTest extends ItopDataTestCase
$this->assertEquals($aExpected, $aActual, 'Unexpected value for functionalcis_list');
}
/**
* @param int|string|null $sTicketId
*
@@ -541,7 +539,7 @@ class UpdateImpactedItemsTest extends ItopDataTestCase
return $this->aCIs[$sDescriptor];
}
private function GivenTicketWithCIsOrPersons(array $aLinkedObjects) : \UserRequest
private function GivenTicketWithCIsOrPersons(array $aLinkedObjects): \UserRequest
{
$oTicket = $this->GivenTicketObject(1);
foreach ($aLinkedObjects as $sObjectDescriptor => $sRole) {