Skip to content

Commit

Permalink
tests: upgrade to phpunit 10
Browse files Browse the repository at this point in the history
  • Loading branch information
lindyhopchris committed Feb 9, 2024
1 parent 2b23f11 commit 01aa76a
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
vendor/
composer.lock
.phpunit.result.cache
.phpunit.cache/
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"require-dev": {
"orchestra/testbench": "^8.0",
"phpunit/phpunit": "^9.5.28"
"phpunit/phpunit": "^10.5"
},
"autoload": {
"psr-4": {
Expand Down
26 changes: 13 additions & 13 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
backupStaticAttributes="false"
beStrictAboutTestsThatDoNotTestAnything="true"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
convertDeprecationsToExceptions="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
verbose="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
failOnWarning="true"
failOnDeprecation="true"
failOnNotice="true"
>
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<coverage/>
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/lib/Unit/</directory>
Expand All @@ -35,4 +30,9 @@
<ini name="error_reporting" value="E_ALL"/>
<env name="DB_CONNECTION" value="testing"/>
</php>
</phpunit>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</source>
</phpunit>
2 changes: 1 addition & 1 deletion tests/lib/Acceptance/EagerLoading/EagerLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class EagerLoaderTest extends TestCase
/**
* @return array[]
*/
public function includePathsProvider(): array
public static function includePathsProvider(): array
{
return [
// 'images' => [
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/Acceptance/Relations/MorphTo/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class QueryTest extends TestCase
/**
* @return array
*/
public function modelProvider(): array
public static function modelProvider(): array
{
return [
'post' => [Post::class],
Expand Down Expand Up @@ -72,7 +72,7 @@ public function testEmpty(): void
/**
* @return array
*/
public function includePathProvider(): array
public static function includePathProvider(): array
{
return [
'post' => [Post::class, 'author,country', 'user'],
Expand Down Expand Up @@ -105,7 +105,7 @@ public function testWithIncludePaths(string $modelClass, string $path, string $r
/**
* @return array
*/
public function defaultEagerLoadProvider(): array
public static function defaultEagerLoadProvider(): array
{
return [
'post' => [PostSchema::class, Post::class, 'user'],
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/Acceptance/SoftDeleteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected function setUp(): void
/**
* @return array
*/
public function trashedProvider(): array
public static function trashedProvider(): array
{
return [
'trashed' => [new Carbon()],
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/Integration/Fields/ArrayHashTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function testSortable(): void
/**
* @return array
*/
public function validProvider(): array
public static function validProvider(): array
{
return [
[[]],
Expand All @@ -105,7 +105,7 @@ public function testFill($value): void
/**
* @return array
*/
public function invalidProvider(): array
public static function invalidProvider(): array
{
return [
[true],
Expand Down Expand Up @@ -484,7 +484,7 @@ public function testReadOnlyOnUpdate(): void
/**
* @return array
*/
public function serializeProvider(): array
public static function serializeProvider(): array
{
return [
[null, null],
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/Integration/Fields/ArrayListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function testSortable(): void
/**
* @return array
*/
public function validProvider(): array
public static function validProvider(): array
{
return [
[[]],
Expand All @@ -105,7 +105,7 @@ public function testFill($value): void
/**
* @return array
*/
public function invalidProvider(): array
public static function invalidProvider(): array
{
return [
[true],
Expand Down Expand Up @@ -254,7 +254,7 @@ public function testReadOnlyOnUpdate(): void
/**
* @return array
*/
public function serializeProvider(): array
public static function serializeProvider(): array
{
return [
[null, null],
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/Integration/Fields/BooleanTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function testSortable(): void
/**
* @return array
*/
public function validProvider(): array
public static function validProvider(): array
{
return [
[true],
Expand All @@ -106,7 +106,7 @@ public function testFill($value): void
/**
* @return array
*/
public function invalidProvider(): array
public static function invalidProvider(): array
{
return [
['foo'],
Expand Down Expand Up @@ -243,7 +243,7 @@ public function testReadOnlyOnUpdate(): void
/**
* @return array
*/
public function serializeProvider(): array
public static function serializeProvider(): array
{
return [
'null' => [null],
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/Integration/Fields/DateTimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function testRetainTimezone(): void
/**
* @return array
*/
public function invalidProvider(): array
public static function invalidProvider(): array
{
return [
[true],
Expand Down
10 changes: 5 additions & 5 deletions tests/lib/Integration/Fields/NumberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function testSortable(): void
/**
* @return array
*/
public function validProvider(): array
public static function validProvider(): array
{
return [
'int' => [1],
Expand Down Expand Up @@ -107,9 +107,9 @@ public function testFill($value): void
/**
* @return array
*/
public function validWithStringProvider(): array
public static function validWithStringProvider(): array
{
return array_merge($this->validProvider(), [
return array_merge(self::validProvider(), [
'int as string' => ['1'],
'float as string' => ['0.1'],
'zero as string' => ['0'],
Expand All @@ -133,7 +133,7 @@ public function testFillAcceptsStrings($value): void
/**
* @return array
*/
public function invalidProvider(): array
public static function invalidProvider(): array
{
return [
[true],
Expand Down Expand Up @@ -163,7 +163,7 @@ public function testFillWithInvalid($value): void
/**
* @return array
*/
public function invalidWhenAcceptingStringsProvider(): array
public static function invalidWhenAcceptingStringsProvider(): array
{
return [
[true],
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/Integration/Fields/SoftDeleteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function testRetainTimezone(): void
/**
* @return array
*/
public function invalidProvider(): array
public static function invalidProvider(): array
{
return [
[true],
Expand Down Expand Up @@ -229,7 +229,7 @@ public function testBooleanIsNull(): void
/**
* @return array
*/
public function invalidBooleanProvider(): array
public static function invalidBooleanProvider(): array
{
return [
['2020-11-23T11:48:17.000000-05:00'],
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/Integration/Fields/StrTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function testSortable(): void
/**
* @return array
*/
public function validProvider(): array
public static function validProvider(): array
{
return [
['Hello World'],
Expand All @@ -106,7 +106,7 @@ public function testFill($value): void
/**
* @return array
*/
public function invalidProvider(): array
public static function invalidProvider(): array
{
return [
[true],
Expand Down

0 comments on commit 01aa76a

Please sign in to comment.