Skip to content

Commit 2c189f8

Browse files
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 <[email protected]>
1 parent b42622c commit 2c189f8

File tree

4 files changed

+19
-33
lines changed

4 files changed

+19
-33
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"phpstan/phpstan": "^1.0.0",
3030
"phpstan/phpstan-phpunit": "^1.0.0",
3131
"phpstan/phpstan-strict-rules": "^1.0.0",
32-
"phpunit/phpunit": "^9.5",
32+
"phpunit/phpunit": "^10.3",
3333
"psalm/plugin-phpunit": "0.18.4",
3434
"psr-mock/http": "^1.0",
3535
"thecodingmachine/phpstan-safe-rule": "^1.0",

phpunit.xml.dist

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4-
beStrictAboutChangesToGlobalState="true"
5-
beStrictAboutOutputDuringTests="true"
6-
beStrictAboutTodoAnnotatedTests="true"
7-
executionOrder="random"
8-
colors="true"
9-
bootstrap="tests/bootstrap.php"
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5+
beStrictAboutChangesToGlobalState="true"
6+
beStrictAboutOutputDuringTests="true"
7+
beStrictAboutTodoAnnotatedTests="true"
8+
executionOrder="random"
9+
colors="true"
10+
bootstrap="tests/bootstrap.php"
1011
>
1112
<testsuites>
1213
<testsuite name="Test Suite">
1314
<directory>tests</directory>
1415
</testsuite>
1516
</testsuites>
16-
<coverage>
17+
<source>
1718
<include>
18-
<directory suffix=".php">src</directory>
19+
<directory>src</directory>
1920
</include>
20-
</coverage>
21+
</source>
2122
</phpunit>

tests/Extractor/ResponseExtractorTest.php

+3-11
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,16 @@
44

55
namespace SimPod\JsonRpc\Extractor;
66

7+
use PHPUnit\Framework\Attributes\CoversClass;
78
use PHPUnit\Framework\TestCase;
89
use PsrMock\Psr17\RequestFactory;
910
use PsrMock\Psr17\StreamFactory;
1011
use PsrMock\Psr18\Client;
1112
use PsrMock\Psr7\Response;
1213

13-
/** @coversDefaultClass \SimPod\JsonRpc\Extractor\ResponseExtractor */
14-
class ResponseExtractorTest extends TestCase
14+
#[CoversClass(ResponseExtractor::class)]
15+
final class ResponseExtractorTest extends TestCase
1516
{
16-
/**
17-
* @covers Extractor::__construct
18-
* @covers ::getResult
19-
*/
2017
public function testResponseResult(): void
2118
{
2219
$responseBody = <<<'EOD'
@@ -55,11 +52,6 @@ public function testResponseResult(): void
5552
self::assertEquals('value', $result['key']);
5653
}
5754

58-
/**
59-
* @covers Extractor::__construct
60-
* @covers ::getId
61-
* @covers ::getVersion
62-
*/
6355
public function testResponse(): void
6456
{
6557
$responseBody = <<<'EOD'

tests/HttpJsonRpcRequestFactoryTest.php

+3-10
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,16 @@
44

55
namespace SimPod\JsonRpc;
66

7+
use PHPUnit\Framework\Attributes\CoversClass;
78
use PHPUnit\Framework\TestCase;
89
use PsrMock\Psr17\RequestFactory;
910
use PsrMock\Psr17\StreamFactory;
1011

1112
use function Safe\preg_replace;
1213

13-
/** @coversDefaultClass \SimPod\JsonRpc\HttpJsonRpcRequestFactory */
14-
class HttpJsonRpcRequestFactoryTest extends TestCase
14+
#[CoversClass(HttpJsonRpcRequestFactory::class)]
15+
final class HttpJsonRpcRequestFactoryTest extends TestCase
1516
{
16-
/**
17-
* @covers ::request
18-
* @covers ::createRequest
19-
*/
2017
public function testRequestBody(): void
2118
{
2219
$messageFactory = new RequestFactory();
@@ -43,10 +40,6 @@ public function testRequestBody(): void
4340
);
4441
}
4542

46-
/**
47-
* @covers ::request
48-
* @covers ::createRequest
49-
*/
5043
public function testRequestHeader(): void
5144
{
5245
$messageFactory = new RequestFactory();

0 commit comments

Comments
 (0)