Skip to content

Commit 00613f1

Browse files
committed
Update phpunit ^10
1 parent 3cd2806 commit 00613f1

File tree

5 files changed

+45
-30
lines changed

5 files changed

+45
-30
lines changed

.github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
matrix:
1818
prefer_lowest: ["", "--prefer-lowest"]
1919
container:
20-
image: skpr/php-cli:8.3-dev-v2-latest
20+
image: skpr/php-cli:8.4-dev-v2-latest
2121
options:
2222
--pull always
2323
--user 1001:1001
@@ -31,7 +31,7 @@ jobs:
3131
- name: 🧹 PHPCS
3232
run: ./bin/phpcs --report=checkstyle -q | ./bin/cs2pr
3333
- name: 🧹 PHPStan
34-
run: ./bin/phpstan --error-format=github analyse
34+
run: ./bin/phpstan --error-format=github analyse -v
3535
- name: ⚡ Run Tests
3636
run: ./bin/phpunit --log-junit phpunit-results.xml
3737
- name: 📝 Publish Test Results

composer.json

+27-8
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,35 @@
11
{
22
"name": "previousnext/phpunit-splitter",
33
"description": "Splits phpunit tests",
4-
"keywords": ["testing"],
4+
"keywords": ["testing", "phpunit"],
55
"license": "GPL-2.0-or-later",
66
"authors": [
77
{
88
"name": "Michael Strelan",
99
"email": "[email protected]"
10+
},
11+
{
12+
"name": "Kim Pepper",
13+
"email": "[email protected]"
1014
}
1115
],
1216
"type": "project",
1317
"require": {
1418
"php": "^8.1",
1519
"ext-simplexml": "*",
16-
"symfony/console": "^6.3|^7.0"
20+
"phpstan/phpstan-deprecation-rules": "^1.2",
21+
"phpstan/phpstan-phpunit": "^1.4",
22+
"symfony/console": "^6.3|^7.2"
1723
},
1824
"require-dev": {
1925
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
26+
"phpstan/extension-installer": "^1.4",
2027
"phpstan/phpstan": "^1.10",
21-
"phpunit/phpunit": "^9.6",
28+
"phpunit/phpunit": "^10",
2229
"previousnext/coding-standard": "^1.1.1",
2330
"staabm/annotate-pull-request-from-checkstyle": "^1.8"
2431
},
25-
"bin" : ["phpunit-splitter"],
26-
"conflict": {
27-
"drupal/coder": "<8.3.21"
28-
},
32+
"bin": ["phpunit-splitter"],
2933
"autoload": {
3034
"psr-4": {"PhpUnitSplitter\\": "src/"}
3135
},
@@ -39,7 +43,22 @@
3943
"sort-packages": true,
4044
"bin-dir": "bin",
4145
"allow-plugins": {
42-
"dealerdirect/phpcodesniffer-composer-installer": true
46+
"dealerdirect/phpcodesniffer-composer-installer": true,
47+
"phpstan/extension-installer": true
4348
}
49+
},
50+
"scripts": {
51+
"phpcs": [
52+
"phpcs"
53+
],
54+
"phpcbf": [
55+
"phpcbf"
56+
],
57+
"phpstan": [
58+
"phpstan analyse --no-progress -v"
59+
],
60+
"phpunit": [
61+
"phpunit"
62+
]
4463
}
4564
}

phpunit.xml

+7-11
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
44
bootstrap="vendor/autoload.php"
5-
cacheResultFile=".phpunit.cache/test-results"
5+
cacheDirectory=".phpunit.cache"
66
executionOrder="depends,defects"
7-
forceCoversAnnotation="true"
8-
beStrictAboutCoversAnnotation="true"
97
beStrictAboutOutputDuringTests="true"
10-
beStrictAboutTodoAnnotatedTests="true"
11-
convertDeprecationsToExceptions="true"
128
failOnRisky="true"
139
failOnWarning="true"
14-
verbose="true">
10+
requireCoverageMetadata="true"
11+
beStrictAboutCoverageMetadata="true"
12+
>
1513
<testsuites>
1614
<testsuite name="default">
1715
<directory>tests/src</directory>
1816
</testsuite>
1917
</testsuites>
20-
21-
<coverage cacheDirectory=".phpunit.cache/code-coverage"
22-
processUncoveredFiles="true">
18+
<source>
2319
<include>
2420
<directory suffix=".php">src</directory>
2521
</include>
26-
</coverage>
22+
</source>
2723
</phpunit>

src/GlobbingTestResultCache.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(
4848
* {@inheritdoc}
4949
*/
5050
public function getState(string $testName): int {
51-
return $this->defects[$testName] ?? TestStatus::UNKNOWN->getValue();
51+
return $this->defects[$testName] ?? TestStatus::Unknown->getValue();
5252
}
5353

5454
/**

src/TestStatus.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
*/
1010
enum TestStatus: int {
1111

12-
case UNKNOWN = -1;
13-
case PASSED = 0;
14-
case SKIPPED = 1;
15-
case INCOMPLETE = 2;
16-
case FAILURE = 3;
17-
case ERROR = 4;
18-
case RISKY = 5;
19-
case WARNING = 6;
12+
case Unknown = -1;
13+
case Passed = 0;
14+
case Skipped = 1;
15+
case Incomplete = 2;
16+
case Failure = 3;
17+
case Error = 4;
18+
case Risky = 5;
19+
case Warning = 6;
2020

2121
/**
2222
* Get the status value.

0 commit comments

Comments
 (0)