Skip to content

Commit 91d8e0c

Browse files
committed
tests: update tests to use PHPUnit 10
1 parent fc5383e commit 91d8e0c

File tree

11 files changed

+25
-35
lines changed

11 files changed

+25
-35
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
vendor/
33
composer.lock
44
.phpunit.result.cache
5+
.phpunit.cache

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
"laravel/framework": "^10.0"
3535
},
3636
"require-dev": {
37-
"laravel-json-api/testing": "^2.0",
37+
"laravel-json-api/testing": "^2.1",
3838
"orchestra/testbench": "^8.0",
39-
"phpunit/phpunit": "^9.5.28"
39+
"phpunit/phpunit": "^10.0"
4040
},
4141
"autoload": {
4242
"psr-4": {

phpunit.xml

+5-16
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
backupGlobals="false"
4-
backupStaticAttributes="false"
5-
beStrictAboutTestsThatDoNotTestAnything="true"
6-
bootstrap="vendor/autoload.php"
7-
colors="true"
8-
convertErrorsToExceptions="true"
9-
convertNoticesToExceptions="true"
10-
convertWarningsToExceptions="true"
11-
convertDeprecationsToExceptions="true"
12-
processIsolation="false"
13-
stopOnError="false"
14-
stopOnFailure="false"
15-
verbose="true"
16-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
17-
>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false"
3+
beStrictAboutTestsThatDoNotTestAnything="true" bootstrap="vendor/autoload.php" colors="true"
4+
processIsolation="false" stopOnError="false" stopOnFailure="false"
5+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" cacheDirectory=".phpunit.cache"
6+
backupStaticProperties="false">
187
<coverage>
198
<include>
209
<directory suffix=".php">src/</directory>

tests/dummy/tests/Api/V1/Posts/UpdateTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function test(): void
9090
/**
9191
* @return array
9292
*/
93-
public function fieldProvider(): array
93+
public static function fieldProvider(): array
9494
{
9595
return [
9696
['content'],

tests/dummy/tests/Api/V1/TestCase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected function setUp(): void
4646
/**
4747
* @return array
4848
*/
49-
public function notAcceptableMediaTypeProvider(): array
49+
public static function notAcceptableMediaTypeProvider(): array
5050
{
5151
return [
5252
'application/json' => ['application/json'],

tests/lib/Acceptance/Relationships/ToManyLinksTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ protected function setUp(): void
6868
/**
6969
* @return array[]
7070
*/
71-
public function scenarioProvider(): array
71+
public static function scenarioProvider(): array
7272
{
7373
return [
7474
'hidden' => [

tests/lib/Acceptance/Relationships/ToOneLinksTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ protected function setUp(): void
6161
/**
6262
* @return array[]
6363
*/
64-
public function scenarioProvider(): array
64+
public static function scenarioProvider(): array
6565
{
6666
return [
6767
'hidden' => [

tests/lib/Integration/Routing/ActionsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ActionsTest extends TestCase
3030
/**
3131
* @return array
3232
*/
33-
public function methodProvider(): array
33+
public static function methodProvider(): array
3434
{
3535
return [
3636
'GET' => ['GET'],

tests/lib/Integration/Routing/HasManyTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class HasManyTest extends TestCase
2929
/**
3030
* @return array
3131
*/
32-
public function genericProvider(): array
32+
public static function genericProvider(): array
3333
{
3434
return [
3535
'showRelated' => [
@@ -181,7 +181,7 @@ public function testUri(string $method, string $uri): void
181181
/**
182182
* @return array[]
183183
*/
184-
public function onlyProvider(): array
184+
public static function onlyProvider(): array
185185
{
186186
return [
187187
['related', [
@@ -259,7 +259,7 @@ public function testOnly($only, array $matches): void
259259
/**
260260
* @return array
261261
*/
262-
public function exceptProvider()
262+
public static function exceptProvider(): array
263263
{
264264
return [
265265
['related', [
@@ -365,7 +365,7 @@ public function testReadOnly(): void
365365
/**
366366
* @return array
367367
*/
368-
public function ownActionProvider(): array
368+
public static function ownActionProvider(): array
369369
{
370370
return [
371371
'showRelated' => [

tests/lib/Integration/Routing/HasOneTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class HasOneTest extends TestCase
2929
/**
3030
* @return array
3131
*/
32-
public function genericProvider(): array
32+
public static function genericProvider(): array
3333
{
3434
return [
3535
'showRelated' => [
@@ -173,7 +173,7 @@ public function testUri(string $method, string $uri, string $action, string $nam
173173
/**
174174
* @return array[]
175175
*/
176-
public function onlyProvider(): array
176+
public static function onlyProvider(): array
177177
{
178178
return [
179179
['related', [
@@ -228,7 +228,7 @@ public function testOnly($only, array $matches): void
228228
/**
229229
* @return array
230230
*/
231-
public function exceptProvider()
231+
public static function exceptProvider(): array
232232
{
233233
return [
234234
['related', [
@@ -308,7 +308,7 @@ public function testReadOnly(): void
308308
/**
309309
* @return array
310310
*/
311-
public function ownActionProvider(): array
311+
public static function ownActionProvider(): array
312312
{
313313
return [
314314
'showRelated' => [

tests/lib/Integration/Routing/ResourceTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ResourceTest extends TestCase
3030
/**
3131
* @return array
3232
*/
33-
public function routeProvider(): array
33+
public static function routeProvider(): array
3434
{
3535
return [
3636
'index' => ['GET', '/api/v1/posts', 'index', false],
@@ -330,7 +330,7 @@ public function testResourceParameter(string $method, string $uri, string $actio
330330
/**
331331
* @return array
332332
*/
333-
public function onlyProvider(): array
333+
public static function onlyProvider(): array
334334
{
335335
return [
336336
['index', [
@@ -390,7 +390,7 @@ public function testOnly($only, array $matches): void
390390
/**
391391
* @return array
392392
*/
393-
public function exceptProvider(): array
393+
public static function exceptProvider(): array
394394
{
395395
return [
396396
['store', [
@@ -474,7 +474,7 @@ public function testReadOnly(): void
474474
/**
475475
* @return array
476476
*/
477-
public function resourceMethodProvider(): array
477+
public static function resourceMethodProvider(): array
478478
{
479479
return [
480480
'GET' => ['GET'],

0 commit comments

Comments
 (0)