diff --git a/CHANGELOG.md b/CHANGELOG.md index 11eb0d7..ca6082b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ 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.1.3] - 2026-08-03 ### Fixed diff --git a/tests/HostTest.php b/tests/HostTest.php index 54b2e24..8cae0f2 100644 --- a/tests/HostTest.php +++ b/tests/HostTest.php @@ -31,11 +31,11 @@ namespace GlpiPlugin\Centreon\tests; use Computer; +use Glpi\Tests\DbTestCase; use GlpiPlugin\Centreon\ApiClient; use GlpiPlugin\Centreon\Host; -use PHPUnit\Framework\TestCase; -class HostTest extends TestCase +class HostTest extends DbTestCase { public function testGetComputerList() { @@ -52,7 +52,20 @@ public function testGetComputerList() public function testOneHost() { + $this->login('glpi'); + + $computer = $this->createItem(Computer::class, [ + 'entities_id' => 0, + 'name' => 'centreon host computer', + ]); + $computers_id = $computer->getID(); + $id = 88; + $this->createItem(Host::class, [ + 'itemtype' => 'Computer', + 'items_id' => $computers_id, + 'centreon_id' => $id, + ]); $api = $this->getMockBuilder(ApiClient::class) ->disableOriginalConstructor()