Skip to content

Commit

Permalink
Keep BC compat with justinrainbow/json-schema v5 and v6
Browse files Browse the repository at this point in the history
Refactor testBCValidateErrorException for better clarity

Simplify the error message assertions by splitting them into two separate checks. This change enhances readability and makes the test failure easier to diagnose.
  • Loading branch information
koriym committed Aug 25, 2024
1 parent 16d6d27 commit d6c0fc9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/Module/JsonSchemaModuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public function testBCValidateException(): JsonSchemaException
/** @depends testValidateException */
public function testBCValidateErrorException(JsonSchemaException $e): void
{
$expected = '[age] Must have a minimum value of 20';
$this->assertStringContainsString($expected, $e->getMessage());
$this->assertStringContainsString('[age]', $e->getMessage());
$this->assertStringContainsString('20', $e->getMessage());
}

public function testException(): void
Expand Down

0 comments on commit d6c0fc9

Please # to comment.