Skip to content

Commit 96f6ff1

Browse files
committed
Bump PHPUnit
1 parent 811da21 commit 96f6ff1

File tree

4 files changed

+25
-33
lines changed

4 files changed

+25
-33
lines changed

.gitignore

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ Thumbs.db
1616
composer.phar
1717
composer.lock
1818

19-
# phpunit itself is not needed
20-
phpunit.phar
21-
# local phpunit config
19+
# PHPUnit
20+
/phpunit.phar
2221
/phpunit.xml
23-
# phpunit cache
24-
.phpunit.result.cache
22+
/.phpunit.cache

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"require-dev": {
5050
"httpsoft/http-message": "^1.1.6",
5151
"maglnet/composer-require-checker": "^4.7.1",
52-
"phpunit/phpunit": "^9.6.22",
52+
"phpunit/phpunit": "^10.5.44",
5353
"psr/event-dispatcher": "^1.0",
5454
"rector/rector": "^2.0.7",
5555
"roave/infection-static-analysis-plugin": "^1.35",

phpunit.xml.dist

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<phpunit bootstrap="vendor/autoload.php"
4-
colors="true"
5-
verbose="true"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
cacheDirectory=".phpunit.cache"
6+
requireCoverageMetadata="false"
7+
beStrictAboutCoverageMetadata="true"
8+
beStrictAboutOutputDuringTests="true"
9+
executionOrder="random"
610
failOnRisky="true"
711
failOnWarning="true"
8-
convertErrorsToExceptions="true"
9-
convertNoticesToExceptions="true"
10-
convertWarningsToExceptions="true"
1112
stopOnFailure="false"
12-
executionOrder="random"
13-
resolveDependencies="true"
13+
colors="true"
14+
displayDetailsOnPhpunitDeprecations="true"
1415
>
1516
<php>
16-
<ini name="error_reporting" value="-1"/>
17+
<ini name="error_reporting" value="-1" />
1718
</php>
1819

1920
<testsuites>
@@ -22,9 +23,9 @@
2223
</testsuite>
2324
</testsuites>
2425

25-
<coverage>
26+
<source>
2627
<include>
27-
<directory>./src</directory>
28+
<directory suffix=".php">./src</directory>
2829
</include>
29-
</coverage>
30+
</source>
3031
</phpunit>

tests/Renderer/HtmlRendererTest.php

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Exception;
88
use HttpSoft\Message\Uri;
9+
use PHPUnit\Framework\Attributes\DataProvider;
910
use PHPUnit\Framework\TestCase;
1011
use Psr\Http\Message\ServerRequestInterface;
1112
use ReflectionClass;
@@ -171,7 +172,7 @@ public function testGetThrowableName(): void
171172
$this->assertSame('Error (' . ErrorException::class . ')', $name);
172173
}
173174

174-
public function createServerInformationLinkDataProvider(): array
175+
public static function createServerInformationLinkDataProvider(): array
175176
{
176177
return [
177178
'not-exist' => [null, ''],
@@ -185,9 +186,7 @@ public function createServerInformationLinkDataProvider(): array
185186
];
186187
}
187188

188-
/**
189-
* @dataProvider createServerInformationLinkDataProvider
190-
*/
189+
#[DataProvider('createServerInformationLinkDataProvider')]
191190
public function testCreateServerInformationLink(?string $serverSoftware, string $expected): void
192191
{
193192
$renderer = new HtmlRenderer();
@@ -199,7 +198,7 @@ public function testCreateServerInformationLink(?string $serverSoftware, string
199198
$this->assertStringContainsString($expected, $renderer->createServerInformationLink($serverRequestMock));
200199
}
201200

202-
public function argumentsToStringValueDataProvider(): array
201+
public static function argumentsToStringValueDataProvider(): array
203202
{
204203
return [
205204
'int' => [[1], '1'],
@@ -222,11 +221,7 @@ public function argumentsToStringValueDataProvider(): array
222221
];
223222
}
224223

225-
/**
226-
* @dataProvider argumentsToStringValueDataProvider
227-
*
228-
* @param mixed $args
229-
*/
224+
#[DataProvider('argumentsToStringValueDataProvider')]
230225
public function testArgumentsToString(array $args, string $expected): void
231226
{
232227
$renderer = new HtmlRenderer();
@@ -270,7 +265,7 @@ public function testGroupVendorCallStackItems(): void
270265
]));
271266
}
272267

273-
public function isVendorFileReturnFalseDataProvider(): array
268+
public static function isVendorFileReturnFalseDataProvider(): array
274269
{
275270
return [
276271
'null' => [null],
@@ -279,9 +274,7 @@ public function isVendorFileReturnFalseDataProvider(): array
279274
];
280275
}
281276

282-
/**
283-
* @dataProvider isVendorFileReturnFalseDataProvider
284-
*/
277+
#[DataProvider('isVendorFileReturnFalseDataProvider')]
285278
public function testIsVendorFileReturnFalse(?string $file): void
286279
{
287280
$this->assertFalse($this->invokeMethod(new HtmlRenderer(), 'isVendorFile', ['file' => $file]));

0 commit comments

Comments
 (0)