From 66b84a78a74253cd92173a234b0f9a2496f52e06 Mon Sep 17 00:00:00 2001 From: sasezaki Date: Sun, 2 Feb 2025 18:39:55 +0900 Subject: [PATCH 1/2] test with PHPUnit 10, 11 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 9bd189e..20beb17 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "psr/log": "^2.0 | ^3.0" }, "require-dev": { - "phpunit/phpunit": "^8.0 | ^9.0", + "phpunit/phpunit": "^8.0 || ^9.0 || ^10.0 || ^11.0", "squizlabs/php_codesniffer": "^3.6" }, "autoload": { From d7f7a96bc9a4f1c4cbeae03d8fe01555e2921544 Mon Sep 17 00:00:00 2001 From: sasezaki Date: Sun, 2 Feb 2025 18:42:42 +0900 Subject: [PATCH 2/2] PHPUnit providers should be static method --- src/Test/LoggerInterfaceTest.php | 2 +- tests/Test/TestLoggerTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Test/LoggerInterfaceTest.php b/src/Test/LoggerInterfaceTest.php index dcb975a..25ac0d0 100644 --- a/src/Test/LoggerInterfaceTest.php +++ b/src/Test/LoggerInterfaceTest.php @@ -54,7 +54,7 @@ public function testLogsAtAllLevels($level, $message) $this->assertEquals($expected, $this->getLogs()); } - public function provideLevelsAndMessages() + public static function provideLevelsAndMessages() { return [ LogLevel::EMERGENCY => [LogLevel::EMERGENCY, 'message of level emergency with context: {user}'], diff --git a/tests/Test/TestLoggerTest.php b/tests/Test/TestLoggerTest.php index 986b0d7..05cc47a 100644 --- a/tests/Test/TestLoggerTest.php +++ b/tests/Test/TestLoggerTest.php @@ -79,7 +79,7 @@ public function testHasRecord(string $level): void $this->assertTrue(call_user_func([$logger, $levelMethod.'ThatPasses'], fn (array $record) => $record['message'] === $level.' Message'), $levelMethod.'ThatMatches'); } - public function getLogLevels(): array + public static function getLogLevels(): array { return [ ['debug'],