From 35ed067c08ae1031b0901b5c670593297621f4ed Mon Sep 17 00:00:00 2001 From: Tim Chandler Date: Fri, 1 Dec 2023 19:25:47 +1100 Subject: [PATCH] Added support for test suite to use PHPUnit 10 --- composer.json | 2 +- phpunit.up-to-9.xml.dist | 24 +++++++++++++++++ phpunit.xml.dist | 48 +++++++++++++++------------------ tests/Unit/FluentDotEnvTest.php | 10 +++---- 4 files changed, 52 insertions(+), 32 deletions(-) create mode 100644 phpunit.up-to-9.xml.dist diff --git a/composer.json b/composer.json index 8494def..1cfbc26 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "require-dev": { "jchook/phpunit-assert-throws": "^1.0", "phpstan/phpstan": "^0.9 | ^0.10 | ^0.11 | ^0.12 | ^1.0", - "phpunit/phpunit": "~4.8 | ^5.0 | ^6.0 | ^7.0 | ^8.0 | ^9.0", + "phpunit/phpunit": "~4.8 | ^5.0 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0", "squizlabs/php_codesniffer": "^3.5" }, "autoload": { diff --git a/phpunit.up-to-9.xml.dist b/phpunit.up-to-9.xml.dist new file mode 100644 index 0000000..08fa34e --- /dev/null +++ b/phpunit.up-to-9.xml.dist @@ -0,0 +1,24 @@ + + + + + ./tests/Unit + + + ./tests/Integration + + + + + ./src + + + + + + diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 7ef466b..184d5b6 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,28 +1,24 @@ - - - - tests - - - - - src/ - - - - - - - - + + + + ./tests/Unit + + + + + + + + + + ./src + + diff --git a/tests/Unit/FluentDotEnvTest.php b/tests/Unit/FluentDotEnvTest.php index 5be8c30..ca96a0f 100644 --- a/tests/Unit/FluentDotEnvTest.php +++ b/tests/Unit/FluentDotEnvTest.php @@ -56,7 +56,7 @@ protected function newFluentDotEnv() * * @return array[] */ - public function CanImportProperlyDataProvider() + public static function CanImportProperlyDataProvider() { $notImported = [ 'UNTOUCHED_KEY' => 'untouched-value', @@ -531,7 +531,7 @@ function () use (&$fDotEnv, $useSafeLoad, $envFilename) { * * @return array[] */ - public function CanCallMethodsInDifferentWaysDataProvider() + public static function CanCallMethodsInDifferentWaysDataProvider() { $imported = [ 'INITIAL_KEY' => 'override-value', @@ -932,7 +932,7 @@ function () use (&$fDotEnv) { * * @return array[] */ - public function canCallValidationAfterLoadDataProvider() + public static function canCallValidationAfterLoadDataProvider() { $validCallback = function (string $key, $value) { return true; @@ -1230,7 +1230,7 @@ function () { * * @return array[] */ - public function canCastProperlyDataProvider() + public static function canCastProperlyDataProvider() { $boolean = [ 'true' => true, @@ -1299,7 +1299,7 @@ public function can_cast_properly(string $castMethod, string $key, $expected) * * @return array[] */ - public function canGetMultipleValuesDataProvider() + public static function canGetMultipleValuesDataProvider() { return [ // GET