Skip to content

Commit 7c49882

Browse files
committed
Added support for PHPUnit v11 and installability with up to PHPUnit v12.
1 parent ceace5b commit 7c49882

File tree

6 files changed

+68
-22
lines changed

6 files changed

+68
-22
lines changed

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
"php": ">=8.1",
2828
"ext-dom": "*",
2929
"ext-json": "*",
30-
"sebastian/cli-parser": "^2.0",
31-
"sebastian/version": "^4.0",
32-
"phpunit/php-file-iterator": "^4.0"
30+
"sebastian/cli-parser": ">=2.0",
31+
"sebastian/version": ">=4.0",
32+
"phpunit/php-file-iterator": ">=4.0"
3333
},
3434
"autoload": {
3535
"classmap": [
@@ -46,6 +46,6 @@
4646
},
4747
"require-dev": {
4848
"phpexperts/dockerize": "^13.0",
49-
"phpunit/phpunit": "10.*"
49+
"phpunit/phpunit": "^10.5|11.*"
5050
}
5151
}

phpunit.v10.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
bootstrap="./vendor/autoload.php"
4+
colors="true"
5+
testdox="true"
6+
stopOnError="true"
7+
stopOnFailure="true"
8+
displayDetailsOnPhpunitDeprecations="true"
9+
displayDetailsOnTestsThatTriggerErrors="true"
10+
displayDetailsOnTestsThatTriggerNotices="true"
11+
displayDetailsOnTestsThatTriggerWarnings="true"
12+
displayDetailsOnTestsThatTriggerDeprecations="true"
13+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
14+
cacheDirectory=".phpunit.cache">
15+
<coverage>
16+
<report>
17+
<html outputDirectory="./coverage" lowUpperBound="35" highLowerBound="85"/>
18+
</report>
19+
</coverage>
20+
<testsuites>
21+
<testsuite name="main">
22+
<directory>./tests</directory>
23+
</testsuite>
24+
</testsuites>
25+
<logging/>
26+
<source>
27+
<include>
28+
<directory suffix=".php">./src</directory>
29+
</include>
30+
</source>
31+
</phpunit>

phpunit.v11.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
bootstrap="./vendor/autoload.php"
4+
colors="true"
5+
testdox="true"
6+
stopOnError="true"
7+
stopOnFailure="true"
8+
displayDetailsOnPhpunitDeprecations="true"
9+
displayDetailsOnTestsThatTriggerErrors="true"
10+
displayDetailsOnTestsThatTriggerNotices="true"
11+
displayDetailsOnTestsThatTriggerWarnings="true"
12+
displayDetailsOnTestsThatTriggerDeprecations="true"
13+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd"
14+
cacheDirectory=".phpunit.cache">
15+
<coverage>
16+
<report>
17+
<html outputDirectory="./coverage" lowUpperBound="35" highLowerBound="85"/>
18+
</report>
19+
</coverage>
20+
<testsuites>
21+
<testsuite name="main">
22+
<directory>./tests</directory>
23+
</testsuite>
24+
</testsuites>
25+
<logging/>
26+
<source>
27+
<include>
28+
<directory suffix=".php">./src</directory>
29+
</include>
30+
</source>
31+
</phpunit>

phpunit.xml

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/CLI/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private function printVersion(): void
8888
{
8989
printf(
9090
'phploc %s by Sebastian Bergmann.' . PHP_EOL,
91-
(new Version(self::VERSION, dirname(__DIR__)))->getVersion()
91+
(new Version(self::VERSION, dirname(__DIR__)))->asString()
9292
);
9393
}
9494

tests/unit/AnalyserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public function testIssue126IsFixed($fileNumber, $cloc): void
294294
$this->assertSame($cloc, $result['cloc'], $assertString);
295295
}
296296

297-
public function issue126Provider()
297+
public static function issue126Provider()
298298
{
299299
// issue_126_X.php => CLOC
300300
return [

0 commit comments

Comments
 (0)