From 05dc2eb0fd7d5c2ec7546770f3a288fd6f0ab2b3 Mon Sep 17 00:00:00 2001 From: Filip Halaxa Date: Fri, 22 Nov 2024 13:13:38 +0100 Subject: [PATCH] dropped compatibility with older phpunit --- .../Exception/SyntaxErrorExceptionTest.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/test/JsonMachineTest/Exception/SyntaxErrorExceptionTest.php b/test/JsonMachineTest/Exception/SyntaxErrorExceptionTest.php index 681f150..b98ff30 100644 --- a/test/JsonMachineTest/Exception/SyntaxErrorExceptionTest.php +++ b/test/JsonMachineTest/Exception/SyntaxErrorExceptionTest.php @@ -16,13 +16,7 @@ class SyntaxErrorExceptionTest extends TestCase { $exception = new SyntaxErrorException('msg 42', 24); - $assertMethod = 'assertContains'; - /* @phpstan-ignore function.alreadyNarrowedType */ - if (method_exists($this, 'assertStringContainsString')) { - $assertMethod = 'assertStringContainsString'; - } - - $this->$assertMethod('msg 42', $exception->getMessage()); - $this->$assertMethod('24', $exception->getMessage()); + $this->assertStringContainsString('msg 42', $exception->getMessage()); + $this->assertStringContainsString('24', $exception->getMessage()); } }