Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
trasher committed Jan 21, 2025
1 parent cc02cee commit 964a002
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/Glpi/Inventory/tests/units/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ public function testFlexibleSchema(): void
{
$json_additionnal = json_decode(json_encode(['deviceid' => 'myid', 'content' => ['versionclient' => 'GLPI-Agent_v1.0', 'additional' => ['name' => 'my extra data']]]));
$instance = new \Glpi\Inventory\Converter();
$instance->setFlexibleSchema();
$instance->setFlexible();
$this->assertTrue($instance->validate($json_additionnal));

//tests same JSON fails with strict schema
$instance->setStrictSchema();
$instance->setStrict();
$this->expectException(\RuntimeException::class);
$this->expectExceptionMessage('Additional properties not allowed: additional');
$this->assertTrue($instance->validate($json_additionnal));
Expand Down

0 comments on commit 964a002

Please sign in to comment.