From 69ebd25b11b2754a3f774b49c6f6b1bb7213d5bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sat, 4 Feb 2023 01:59:42 +0100 Subject: [PATCH] Update test environment to PHPUnit 10 --- composer.json | 2 +- phpunit.xml.dist | 9 ++++----- phpunit.xml.legacy | 4 ++-- tests/AppTest.php | 2 +- tests/ContainerTest.php | 2 +- tests/ErrorHandlerTest.php | 4 ++-- tests/Io/HtmlHandlerTest.php | 2 +- 7 files changed, 12 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index 06333f4..15b6a40 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ }, "require-dev": { "phpstan/phpstan": "1.9.2 || 1.4.10", - "phpunit/phpunit": "^9.5 || ^7.5", + "phpunit/phpunit": "^10 || ^9.5 || ^7.5", "psr/container": "^2 || ^1" }, "autoload": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 2c828a1..3ad344f 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,12 +1,11 @@ - + + colors="true"> ./tests/ @@ -21,7 +20,7 @@ - + diff --git a/phpunit.xml.legacy b/phpunit.xml.legacy index 8b1885e..5bab1e8 100644 --- a/phpunit.xml.legacy +++ b/phpunit.xml.legacy @@ -1,6 +1,6 @@ - + - + diff --git a/tests/AppTest.php b/tests/AppTest.php index 7a2218e..5d7eeef 100644 --- a/tests/AppTest.php +++ b/tests/AppTest.php @@ -1902,7 +1902,7 @@ public function testHandleRequestWithMatchingRouteReturnsInternalServerErrorResp $this->assertStringMatchesFormat("%a

Expected request handler to return Psr\Http\Message\ResponseInterface but got uncaught BadMethodCallException with message Request handler class UnknownClass not found in Container.php:%d.

\n%a", (string) $response->getBody()); } - public function provideInvalidClasses(): \Generator + public static function provideInvalidClasses(): \Generator { yield [ InvalidConstructorPrivate::class, diff --git a/tests/ContainerTest.php b/tests/ContainerTest.php index 389757c..a125a66 100644 --- a/tests/ContainerTest.php +++ b/tests/ContainerTest.php @@ -567,7 +567,7 @@ public function __invoke(): ResponseInterface } /** @return list> */ - public function provideMixedValue(): array + public static function provideMixedValue(): array { return [ [ diff --git a/tests/ErrorHandlerTest.php b/tests/ErrorHandlerTest.php index 905c1e8..e7562e3 100644 --- a/tests/ErrorHandlerTest.php +++ b/tests/ErrorHandlerTest.php @@ -387,7 +387,7 @@ public function testRequestProxyUnsupportedReturnsError400(): void } /** @return list> */ - public function provideExceptionMessage(): array + public static function provideExceptionMessage(): array { return [ [ @@ -459,7 +459,7 @@ public function testErrorInvalidExceptionReturnsError500(string $in, string $exp } /** @return list> */ - public function provideInvalidReturnValue(): array + public static function provideInvalidReturnValue(): array { return [ [ diff --git a/tests/Io/HtmlHandlerTest.php b/tests/Io/HtmlHandlerTest.php index 1a106d9..1164529 100644 --- a/tests/Io/HtmlHandlerTest.php +++ b/tests/Io/HtmlHandlerTest.php @@ -20,7 +20,7 @@ public function testEscapeHtml(string $in, string $expected): void } /** @return list> */ - public function provideNames(): array + public static function provideNames(): array { return [ [