Merge remote-tracking branch 'origin/support/3.2' into develop

This commit is contained in:
jf-cbd
2024-10-23 17:56:09 +02:00
48 changed files with 2412 additions and 395 deletions

View File

@@ -79,21 +79,18 @@ class UpdateImpactedItemsTest extends ItopDataTestCase
{
/**
* Server1 +----> Hypervisor1
* Server2 +----> Hypervisor1
*/
$this->GivenCITreeInDB(<<<EOF
Hypervisor_1 -> Server_1
Hypervisor_1 -> Server_2
EOF);
$oTicket = $this->GivenTicketWithCIsOrPersons([
'Server_1' => 'manual'
'Hypervisor_1' => 'manual'
]);
$oTicket->UpdateImpactedItems(); // impact analysis
$this->assertCIsOrPersonsListEquals($oTicket, [
'Server_1' => 'manual',
'Hypervisor_1' => 'computed'
'Hypervisor_1' => 'manual',
]);
}

View File

@@ -0,0 +1,49 @@
<?php
namespace Combodo\iTop\Test\UnitTest\Sources\Controller;
use Combodo\iTop\Portal\Controller\AggregatePageBrickController;
use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
class BootSymfonyKernelTest extends ItopDataTestCase
{
public function testInstantiateServiceWithAnExplicitCallToBootTheKernel()
{
$this->SetKernelClass(\Combodo\iTop\Portal\Kernel::class);
self::bootKernel();
$controller = static::getContainer()->get(AggregatePageBrickController::class);
$this->assertInstanceOf(AggregatePageBrickController::class, $controller);
}
public function testInstantiateServiceWithAnAutomaticKernelBoot()
{
$this->SetKernelClass(\Combodo\iTop\Portal\Kernel::class);
$controller = static::getContainer()->get(AggregatePageBrickController::class);
$this->assertInstanceOf(AggregatePageBrickController::class, $controller);
}
public function testUnspecifiedKernelClassThrowsAnException()
{
$this->expectException(\LogicException::class);
$this->expectExceptionMessage('static::SetKernelClass() must be called before booting the kernel');
static::getContainer();
}
public function testTwoDifferentKernelsCanBeStartedConsecutively()
{
self::markTestSkipped('This test is still failing: the second kernel container does not find the requested service');
$this->SetKernelClass(\Combodo\iTop\Kernel::class);
self::bootKernel();
$this->SetKernelClass(\Combodo\iTop\Portal\Kernel::class);
self::bootKernel();
$controller = static::getContainer()->get(AggregatePageBrickController::class);
$this->assertInstanceOf(AggregatePageBrickController::class, $controller);
}
}