Skip to content

Commit

Permalink
Fixed a warning in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
halaxa committed Nov 30, 2023
1 parent 5147f38 commit bd675a3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/JsonMachineTest/Exception/SyntaxErrorExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ public function testMessageContainsDataFromConstructor()
{
$exception = new SyntaxErrorException('msg 42', 24);

$this->assertContains('msg 42', $exception->getMessage());
$this->assertContains('24', $exception->getMessage());
$assertMethod = 'assertContains';
if (method_exists($this, 'assertStringContainsString')) {
$assertMethod = 'assertStringContainsString';
}

$this->$assertMethod('msg 42', $exception->getMessage());
$this->$assertMethod('24', $exception->getMessage());
}
}

0 comments on commit bd675a3

Please sign in to comment.