From 2c189f8381e2df53e914013584db0985bb3971bc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 09:06:55 +0200 Subject: [PATCH] chore(deps): update dependency phpunit/phpunit to v10 (#54) * chore(deps): update dependency phpunit/phpunit to v10 * chore(phpunit): adapt config * chore(phpunit): use attributes * chore(deps): use phpunit v10.3 --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Simon Podlipsky --- composer.json | 2 +- phpunit.xml.dist | 23 ++++++++++++----------- tests/Extractor/ResponseExtractorTest.php | 14 +++----------- tests/HttpJsonRpcRequestFactoryTest.php | 13 +++---------- 4 files changed, 19 insertions(+), 33 deletions(-) diff --git a/composer.json b/composer.json index 0b6a0e3..6ae7da2 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "phpstan/phpstan": "^1.0.0", "phpstan/phpstan-phpunit": "^1.0.0", "phpstan/phpstan-strict-rules": "^1.0.0", - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^10.3", "psalm/plugin-phpunit": "0.18.4", "psr-mock/http": "^1.0", "thecodingmachine/phpstan-safe-rule": "^1.0", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 9247927..e2f9946 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,21 +1,22 @@ - tests - + - src + src - + diff --git a/tests/Extractor/ResponseExtractorTest.php b/tests/Extractor/ResponseExtractorTest.php index 15dee46..5d50476 100644 --- a/tests/Extractor/ResponseExtractorTest.php +++ b/tests/Extractor/ResponseExtractorTest.php @@ -4,19 +4,16 @@ namespace SimPod\JsonRpc\Extractor; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use PsrMock\Psr17\RequestFactory; use PsrMock\Psr17\StreamFactory; use PsrMock\Psr18\Client; use PsrMock\Psr7\Response; -/** @coversDefaultClass \SimPod\JsonRpc\Extractor\ResponseExtractor */ -class ResponseExtractorTest extends TestCase +#[CoversClass(ResponseExtractor::class)] +final class ResponseExtractorTest extends TestCase { - /** - * @covers Extractor::__construct - * @covers ::getResult - */ public function testResponseResult(): void { $responseBody = <<<'EOD' @@ -55,11 +52,6 @@ public function testResponseResult(): void self::assertEquals('value', $result['key']); } - /** - * @covers Extractor::__construct - * @covers ::getId - * @covers ::getVersion - */ public function testResponse(): void { $responseBody = <<<'EOD' diff --git a/tests/HttpJsonRpcRequestFactoryTest.php b/tests/HttpJsonRpcRequestFactoryTest.php index 58c326e..0a14968 100644 --- a/tests/HttpJsonRpcRequestFactoryTest.php +++ b/tests/HttpJsonRpcRequestFactoryTest.php @@ -4,19 +4,16 @@ namespace SimPod\JsonRpc; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use PsrMock\Psr17\RequestFactory; use PsrMock\Psr17\StreamFactory; use function Safe\preg_replace; -/** @coversDefaultClass \SimPod\JsonRpc\HttpJsonRpcRequestFactory */ -class HttpJsonRpcRequestFactoryTest extends TestCase +#[CoversClass(HttpJsonRpcRequestFactory::class)] +final class HttpJsonRpcRequestFactoryTest extends TestCase { - /** - * @covers ::request - * @covers ::createRequest - */ public function testRequestBody(): void { $messageFactory = new RequestFactory(); @@ -43,10 +40,6 @@ public function testRequestBody(): void ); } - /** - * @covers ::request - * @covers ::createRequest - */ public function testRequestHeader(): void { $messageFactory = new RequestFactory();