From 3295e4b753deb9e4839460c77c9e759f51677176 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sat, 2 Nov 2024 11:06:44 +0100 Subject: [PATCH] Add support for PHPUnit 11 --- composer.json | 2 +- tests/AbstractZodiacTest.php | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 8d626ae..5c0697d 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "illuminate/translation": "^6|^7|^8|^9|^10|^11" }, "require-dev": { - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^10.0 || ^11.0", "phpstan/phpstan": "^1", "squizlabs/php_codesniffer": "^3.8", "slevomat/coding-standard": "~8.0" diff --git a/tests/AbstractZodiacTest.php b/tests/AbstractZodiacTest.php index 1e197b9..6c33873 100644 --- a/tests/AbstractZodiacTest.php +++ b/tests/AbstractZodiacTest.php @@ -12,7 +12,7 @@ final class AbstractZodiacTest extends TestCase { public function testMatch(): void { - $zodiac = $this->getMockForAbstractClass(AbstractZodiac::class); + $zodiac = $this->zodiac(); $zodiac->start = ['month' => '6', 'day' => '1']; $zodiac->end = ['month' => '6', 'day' => '10']; @@ -24,7 +24,7 @@ public function testMatch(): void public function testLocalized(): void { - $zodiac = $this->getMockForAbstractClass(AbstractZodiac::class); + $zodiac = $this->zodiac(); $zodiac->name = 'gemini'; $this->assertEquals('Gemini', $zodiac->localized()); @@ -32,9 +32,17 @@ public function testLocalized(): void public function testToString(): void { - $zodiac = $this->getMockForAbstractClass(AbstractZodiac::class); + $zodiac = $this->zodiac(); $zodiac->name = 'mock'; $this->assertEquals('mock', strval($zodiac)); } + + private function zodiac(): AbstractZodiac + { + return new class () extends AbstractZodiac + { + // + }; + } }