Skip to content

Commit 75b73cf

Browse files
committed
tests: upgrade to phpunit 10
1 parent 0b29c36 commit 75b73cf

28 files changed

+87
-80
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
vendor/
22
composer.lock
3-
.phpunit.result.cache
3+
.phpunit.cache/

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"laravel/ui": "^4.2",
3939
"mockery/mockery": "^1.1",
4040
"orchestra/testbench": "^8.0",
41-
"phpunit/phpunit": "^9.5.28"
41+
"phpunit/phpunit": "^10.5"
4242
},
4343
"suggest": {
4444
"cloudcreativity/json-api-testing": "Required to use the test helpers."

phpunit.xml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
backupGlobals="false"
4-
backupStaticAttributes="false"
54
beStrictAboutTestsThatDoNotTestAnything="true"
65
bootstrap="vendor/autoload.php"
76
colors="true"
8-
convertErrorsToExceptions="true"
9-
convertNoticesToExceptions="true"
10-
convertWarningsToExceptions="true"
11-
convertDeprecationsToExceptions="true"
127
processIsolation="false"
138
stopOnError="false"
149
stopOnFailure="false"
15-
verbose="true"
16-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
10+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd"
11+
cacheDirectory=".phpunit.cache"
12+
backupStaticProperties="false"
13+
failOnWarning="true"
14+
failOnDeprecation="true"
15+
failOnNotice="true"
1716
>
18-
<coverage>
19-
<include>
20-
<directory suffix=".php">src/</directory>
21-
</include>
22-
</coverage>
17+
<coverage/>
2318
<testsuites>
2419
<testsuite name="Unit">
2520
<directory suffix="Test.php">./tests/lib/Unit/</directory>
@@ -36,4 +31,9 @@
3631
<ini name="memory_limit" value="256M"/>
3732
<env name="APP_KEY" value="base64:BMfTqJC1cFk6A/jTPsjQgC+cROx7TDaEeGIAat6CuqY="/>
3833
</php>
39-
</phpunit>
34+
<source>
35+
<include>
36+
<directory suffix=".php">src/</directory>
37+
</include>
38+
</source>
39+
</phpunit>

tests/dummy/tests/Feature/Avatars/TestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected function setUp(): void
3737
/**
3838
* @return array
3939
*/
40-
public function fieldProvider(): array
40+
public static function fieldProvider(): array
4141
{
4242
return [
4343
'created-at' => ['created-at'],
@@ -50,7 +50,7 @@ public function fieldProvider(): array
5050
/**
5151
* @return array
5252
*/
53-
public function multipartProvider(): array
53+
public static function multipartProvider(): array
5454
{
5555
return [
5656
'form-data' => ['multipart/form-data'],

tests/lib/Integration/Auth/AuthTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function testApiAuthAllowed()
6868
/**
6969
* @return array
7070
*/
71-
public function resourceAuthProvider()
71+
public static function resourceAuthProvider()
7272
{
7373
return [
7474
[false, 'posts', 200],

tests/lib/Integration/Eloquent/HasOneTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function testCreateWithNull()
7878
/**
7979
* @return array
8080
*/
81-
public function confirmationProvider(): array
81+
public static function confirmationProvider(): array
8282
{
8383
return [
8484
['passwordConfirmation', 'foo'],

tests/lib/Integration/ErrorsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function testCustom404()
7171
/**
7272
* @return array
7373
*/
74-
public function invalidDocumentProvider()
74+
public static function invalidDocumentProvider()
7575
{
7676
return [
7777
'empty' => [''],
@@ -118,7 +118,7 @@ public function testDocumentRequired($content, $method = 'POST')
118118
/**
119119
* @return array
120120
*/
121-
public function ignoreDocumentProvider()
121+
public static function ignoreDocumentProvider()
122122
{
123123
return [
124124
'empty' => [''],

tests/lib/Integration/GeneratorsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ protected function tearDown(): void
9595
/**
9696
* @return array
9797
*/
98-
public function byResourceProvider()
98+
public static function byResourceProvider()
9999
{
100100
return [
101101
'by-resource' => [true],

tests/lib/Integration/Issue154/IssueTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected function setUp(): void
4444
/**
4545
* @return array
4646
*/
47-
public function createProvider()
47+
public static function createProvider()
4848
{
4949
return [
5050
['saving', ['creating', 'saved', 'created']],
@@ -93,7 +93,7 @@ public function testCreate($hook, array $unexpected)
9393
/**
9494
* @return array
9595
*/
96-
public function updateProvider()
96+
public static function updateProvider()
9797
{
9898
return [
9999
['saving', ['updating', 'saved', 'updated']],
@@ -133,7 +133,7 @@ public function testUpdate($hook, array $unexpected)
133133
/**
134134
* @return array
135135
*/
136-
public function deleteProvider()
136+
public static function deleteProvider()
137137
{
138138
return [
139139
['deleting', ['deleted']],

tests/lib/Integration/Queue/ControllerHooksTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected function setUp(): void
4242
$mock = $this
4343
->getMockBuilder(Adapter::class)
4444
->setConstructorArgs([new StandardStrategy()])
45-
->setMethods(['create', 'update','delete'])
45+
->onlyMethods(['create', 'update','delete'])
4646
->getMock();
4747

4848
$mock->expects($this->never())->method('create');

0 commit comments

Comments
 (0)