Skip to content
Merged

Fix ci #1218

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [unreleased]


## [1.24.2] - 2026-06-30

### Fixed
Expand Down
5 changes: 3 additions & 2 deletions tests/QuestionTypeTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
use Glpi\Form\Form;
use Glpi\Tests\DbTestCase;
use Glpi\Tests\FormTesterTrait;
use Glpi\Tests\GLPITestCase;
use PluginFieldsContainer;
use PluginFieldsField;
use ReflectionClass;
Expand Down Expand Up @@ -82,13 +83,13 @@ public function createFieldAndContainer(): void
public function setUp(): void
{
$this->createFieldAndContainer();
parent::setUp();
GLPITestCase::setUp();
}

public function tearDown(): void
{
$this->tearDownFieldTest();
parent::tearDown();
GLPITestCase::tearDown();
}

protected function renderFormEditor(Form $form): Crawler
Expand Down
21 changes: 19 additions & 2 deletions tests/Units/ContainerItemUpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
namespace GlpiPlugin\Field\Tests\Units;

use Glpi\Tests\DbTestCase;
use Glpi\Tests\GLPITestCase;
use GlpiPlugin\Field\Tests\FieldTestTrait;
use PluginFieldsContainer;
use Ticket;
Expand Down Expand Up @@ -58,12 +59,25 @@ final class ContainerItemUpdateTest extends DbTestCase
{
use FieldTestTrait;

public function setUp(): void
{
GLPITestCase::setUp();
}

public function tearDown(): void
{
$this->tearDownFieldTest();
parent::tearDown();
global $DB;
$DB->setMustUnsanitizeData(false); // Be sure to switch back to disabled unsanitization.

$container = new PluginFieldsContainer();
foreach ($container->find() as $container_fields) {
$container->delete($container_fields, true);
}

GLPITestCase::tearDown();
}


// -----------------------------------------------------------------------
// Helpers
// -----------------------------------------------------------------------
Expand Down Expand Up @@ -652,6 +666,9 @@ public function testOnlyOneDomContainerAllowedPerItemtype(): void
]);

$this->assertFalse((bool) $result, 'Creating a second DOM container for the same itemtype must be rejected.');

// message should be checked manually
$this->hasSessionMessages(ERROR, ["You cannot add several blocks with type 'Insertion in the form' on same object"]);
}

// -----------------------------------------------------------------------
Expand Down
5 changes: 3 additions & 2 deletions tests/Units/ContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

use Computer;
use Glpi\Tests\DbTestCase;
use Glpi\Tests\GLPITestCase;
use GlpiPlugin\Field\Tests\FieldTestTrait;
use PHPUnit\Framework\Attributes\DataProvider;
use PluginFieldsContainer;
Expand All @@ -44,14 +45,14 @@ final class ContainerTest extends DbTestCase

public function setUp(): void
{
parent::setUp();
GLPITestCase::setUp();
$this->login();
}

public function tearDown(): void
{
$this->tearDownFieldTest();
parent::tearDown();
GLPITestCase::tearDown();
}

public static function provideInvalidItemtypes(): iterable
Expand Down
13 changes: 11 additions & 2 deletions tests/Units/FieldDestinationFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
use Glpi\Tests\AbstractDestinationFieldTest;
use Glpi\Tests\FormBuilder;
use Glpi\Tests\FormTesterTrait;
use Glpi\Tests\GLPITestCase;
use GlpiPlugin\Field\Tests\FieldTestTrait;
use Group;
use Location;
Expand All @@ -63,6 +64,11 @@ final class FieldDestinationFieldTest extends AbstractDestinationFieldTest

private function initFieldTest(): void
{
$container = new PluginFieldsContainer();
foreach ($container->find() as $container_fields) {
$container->delete($container_fields, true);
}

$this->blocks[Ticket::class] = $this->createFieldContainer([
'label' => 'Ticket additional fields',
'type' => 'dom',
Expand Down Expand Up @@ -125,12 +131,12 @@ private function initFieldTest(): void
public function setUp(): void
{
$this->initFieldTest();
parent::setUp();
GLPITestCase::setUp();
}

public function tearDown(): void
{
parent::tearDown();
GLPITestCase::tearDown();
$this->tearDownFieldTest();
}

Expand Down Expand Up @@ -238,6 +244,9 @@ public function testDestinationWithLocationAdditonalFields(): void
],
],
);

// delete location for another run
$location->delete($location->fields, true);
}

#[Override]
Expand Down