Skip to content

Commit 0ffa65a

Browse files
author
matt
committed
Update to phpunit 10
1 parent 9a31409 commit 0ffa65a

6 files changed

+29
-32
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/.phpcs-cache
2-
/.phpunit.result.cache
2+
/.phpunit.cache
33
/phpunit.xml
44
/vendor/

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"laminas/laminas-coding-standard": "^2.4",
3535
"laminas/laminas-diactoros": "^2.24",
3636
"laminas/laminas-servicemanager": "^3.20",
37-
"phpunit/phpunit": "^9.5.11",
37+
"phpunit/phpunit": "^10.4",
3838
"roave/security-advisories": "dev-master",
3939
"squizlabs/php_codesniffer": "^3.7",
4040
"vimeo/psalm": "^4.28"

phpunit.xml.dist

+21-24
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5-
beStrictAboutCoversAnnotation="true"
6-
beStrictAboutOutputDuringTests="true"
7-
beStrictAboutTodoAnnotatedTests="true"
8-
bootstrap="vendor/autoload.php"
9-
convertDeprecationsToExceptions="true"
10-
executionOrder="depends,defects"
11-
failOnRisky="true"
12-
failOnWarning="true"
13-
verbose="true"
14-
colors="true">
15-
<testsuites>
16-
<testsuite name="default">
17-
<directory suffix="Test.php">test</directory>
18-
</testsuite>
19-
</testsuites>
20-
21-
<coverage processUncoveredFiles="true">
22-
<include>
23-
<directory suffix=".php">src</directory>
24-
</include>
25-
</coverage>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
cacheDirectory=".phpunit.cache"
7+
executionOrder="depends,defects"
8+
failOnRisky="true"
9+
failOnWarning="true"
10+
beStrictAboutOutputDuringTests="true"
11+
beStrictAboutCoverageMetadata="true">
12+
<testsuites>
13+
<testsuite name="default">
14+
<directory suffix="Test.php">test</directory>
15+
</testsuite>
16+
</testsuites>
17+
<coverage/>
18+
<source>
19+
<include>
20+
<directory suffix=".php">src</directory>
21+
</include>
22+
</source>
2623
</phpunit>

test/ConfigProviderTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function testDependenciesResolve(string $dependency): void
6262
self::assertInstanceOf($dependency, $actual);
6363
}
6464

65-
public function dependencyProvider(): Generator
65+
public static function dependencyProvider(): Generator
6666
{
6767
$config = (new ConfigProvider())();
6868
foreach (array_keys($config['dependencies']['factories']) as $dependency) {

test/Operation/ContentTypeNegotiatorTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function testMatchContentTypeReturnsMatched(string $mimeType, string $exp
5757
self::assertSame($expected, $actual);
5858
}
5959

60-
public function matchedContentTypeProvider(): array
60+
public static function matchedContentTypeProvider(): array
6161
{
6262
return [
6363
'application/geo+json' => ['application/geo+json', 'application/geo+json'],

test/Operation/OperationUtilTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testGetPathVariablesPopulatesPathParams(string $path, string $te
4040
* Note that it is impossible to distinguish between array and object notation unless explode is used. Parsers
4141
* will need to account for this and use the schema type to determine how the returned array is represented.
4242
*/
43-
public function pathVariableProvider(): array
43+
public static function pathVariableProvider(): array
4444
{
4545
return [
4646
'simple_primitive' => ['/users/3', '/users/{id}', ['id' => '3']],
@@ -79,7 +79,7 @@ public function testGetQueryVariablesPopulatesQueryParams(string $query, string
7979
/**
8080
* @fixme space_explode and pipe_explode will require custom handling, similar to `rize/url-template` '%' operator
8181
*/
82-
public function queryVariableProvider(): array
82+
public static function queryVariableProvider(): array
8383
{
8484
return [
8585
'form_explode_primitive' => ['?id=5', '{?id*}', ['id' => ['5']]],
@@ -111,7 +111,7 @@ public function testGetHeaderVariablesPopulatesHeaderParams(array $headers, arra
111111
self::assertEquals($expected, $actual);
112112
}
113113

114-
public function headerVariableProvider(): array
114+
public static function headerVariableProvider(): array
115115
{
116116
// phpcs:disable Generic.Files.LineLength.TooLong
117117
return [
@@ -138,7 +138,7 @@ public function testGetCookieVariablesPopulatesCookieParams(array $cookies, arra
138138
self::assertEquals($expected, $actual);
139139
}
140140

141-
public function cookieVariableProvider(): array
141+
public static function cookieVariableProvider(): array
142142
{
143143
return [
144144
'form_explode_primitive' => [['id' => '5'], ['id' => '{id*}'], ['id' => ['5']]],

0 commit comments

Comments
 (0)