Skip to content

Commit 35ed067

Browse files
Added support for test suite to use PHPUnit 10
1 parent bb7a135 commit 35ed067

File tree

4 files changed

+52
-32
lines changed

4 files changed

+52
-32
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"require-dev": {
3232
"jchook/phpunit-assert-throws": "^1.0",
3333
"phpstan/phpstan": "^0.9 | ^0.10 | ^0.11 | ^0.12 | ^1.0",
34-
"phpunit/phpunit": "~4.8 | ^5.0 | ^6.0 | ^7.0 | ^8.0 | ^9.0",
34+
"phpunit/phpunit": "~4.8 | ^5.0 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0",
3535
"squizlabs/php_codesniffer": "^3.5"
3636
},
3737
"autoload": {

phpunit.up-to-9.xml.dist

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?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+
bootstrap="vendor/autoload.php"
6+
colors="true"
7+
>
8+
<testsuites>
9+
<testsuite name="Unit">
10+
<directory suffix="Test.php">./tests/Unit</directory>
11+
</testsuite>
12+
<testsuite name="Integration">
13+
<directory suffix="Test.php">./tests/Integration</directory>
14+
</testsuite>
15+
</testsuites>
16+
<coverage processUncoveredFiles="true">
17+
<include>
18+
<directory suffix=".php">./src</directory>
19+
</include>
20+
<report>
21+
<html outputDirectory="build/coverage"/>
22+
</report>
23+
</coverage>
24+
</phpunit>

phpunit.xml.dist

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="vendor/autoload.php"
3-
backupGlobals="true"
4-
backupStaticAttributes="false"
5-
colors="true"
6-
verbose="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
10-
processIsolation="false"
11-
stopOnFailure="false">
12-
<testsuites>
13-
<testsuite name="Test Suite">
14-
<directory>tests</directory>
15-
</testsuite>
16-
</testsuites>
17-
<filter>
18-
<whitelist>
19-
<directory suffix=".php">src/</directory>
20-
</whitelist>
21-
</filter>
22-
<logging>
23-
<log type="junit" target="build/report.junit.xml"/>
24-
<log type="coverage-html" target="build/coverage"/>
25-
<log type="coverage-text" target="build/coverage.txt"/>
26-
<log type="coverage-clover" target="build/logs/clover.xml"/>
27-
</logging>
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
5+
bootstrap="vendor/autoload.php"
6+
colors="true"
7+
cacheDirectory="phpunit/cache"
8+
>
9+
<testsuites>
10+
<testsuite name="Unit">
11+
<directory suffix="Test.php">./tests/Unit</directory>
12+
</testsuite>
13+
</testsuites>
14+
<coverage>
15+
<report>
16+
<html outputDirectory="phpunit/coverage"/>
17+
</report>
18+
</coverage>
19+
<source>
20+
<include>
21+
<directory suffix=".php">./src</directory>
22+
</include>
23+
</source>
2824
</phpunit>

tests/Unit/FluentDotEnvTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ protected function newFluentDotEnv()
5656
*
5757
* @return array[]
5858
*/
59-
public function CanImportProperlyDataProvider()
59+
public static function CanImportProperlyDataProvider()
6060
{
6161
$notImported = [
6262
'UNTOUCHED_KEY' => 'untouched-value',
@@ -531,7 +531,7 @@ function () use (&$fDotEnv, $useSafeLoad, $envFilename) {
531531
*
532532
* @return array[]
533533
*/
534-
public function CanCallMethodsInDifferentWaysDataProvider()
534+
public static function CanCallMethodsInDifferentWaysDataProvider()
535535
{
536536
$imported = [
537537
'INITIAL_KEY' => 'override-value',
@@ -932,7 +932,7 @@ function () use (&$fDotEnv) {
932932
*
933933
* @return array[]
934934
*/
935-
public function canCallValidationAfterLoadDataProvider()
935+
public static function canCallValidationAfterLoadDataProvider()
936936
{
937937
$validCallback = function (string $key, $value) {
938938
return true;
@@ -1230,7 +1230,7 @@ function () {
12301230
*
12311231
* @return array[]
12321232
*/
1233-
public function canCastProperlyDataProvider()
1233+
public static function canCastProperlyDataProvider()
12341234
{
12351235
$boolean = [
12361236
'true' => true,
@@ -1299,7 +1299,7 @@ public function can_cast_properly(string $castMethod, string $key, $expected)
12991299
*
13001300
* @return array[]
13011301
*/
1302-
public function canGetMultipleValuesDataProvider()
1302+
public static function canGetMultipleValuesDataProvider()
13031303
{
13041304
return [
13051305
// GET

0 commit comments

Comments
 (0)