Skip to content

Commit e32ca0f

Browse files
Merge pull request #11 from robiningelbrecht/phpunit-12-support
PHPUnit 12 support
2 parents e1a3bce + 7e7c0cc commit e32ca0f

File tree

8 files changed

+1426
-898
lines changed

8 files changed

+1426
-898
lines changed

.github/workflows/ci.yml

-8
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,3 @@ jobs:
4242

4343
- name: Run test suite
4444
run: vendor/bin/phpunit --fail-on-incomplete --log-junit junit.xml --coverage-clover clover.xml
45-
46-
# https://github.com/marketplace/actions/codecov
47-
- name: Send test coverage to codecov.io
48-
uses: codecov/codecov-action@v3
49-
with:
50-
files: clover.xml
51-
fail_ci_if_error: true # optional (default = false)
52-
verbose: true # optional (default = false)

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"require": {
1818
"php": "^8.1",
1919
"nunomaduro/collision": "^7.8|^8.0",
20-
"phpunit/phpunit": "^10.3|^11.0"
20+
"phpunit/phpunit": "^10.3|^11.0|^12.0"
2121
},
2222
"autoload": {
2323
"psr-4": {

composer.lock

+1,404-884
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker-compose.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
services:
2+
php-cli:
3+
build: ./docker/php-cli
4+
container_name: phpunit-pretty-print-php-cli
5+
environment:
6+
- PHP_CS_FIXER_IGNORE_ENV=true
7+
volumes:
8+
- ./:/var/www/
9+
working_dir: /var/www
10+

docker/php-cli/Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM php:8.4-cli
2+
3+
RUN apt-get update && apt-get install -y zip unzip git curl
4+
RUN docker-php-ext-install mysqli pdo pdo_mysql
5+
6+
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

src/PhpUnitExtension.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ public function bootstrap(PHPUnitConfiguration $configuration, Facade $facade, P
4343

4444
private function isEnabled(ParameterCollection $parameters): bool
4545
{
46-
if (!$parameters->has('enableByDefault') &&
47-
!in_array('--enable-pretty-print', $_SERVER['argv'], true) &&
48-
!in_array('--disable-pretty-print', $_SERVER['argv'], true)) {
46+
if (!$parameters->has('enableByDefault')
47+
&& !in_array('--enable-pretty-print', $_SERVER['argv'], true)
48+
&& !in_array('--disable-pretty-print', $_SERVER['argv'], true)) {
4949
// Nothing has been set, assume the extension is enabled for backwards compatible reasons.
5050
return true;
5151
}

tests/Unit/Subscriber/Application/ApplicationFinishedSubscriberTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testNotify(): void
3232
HRTime::fromSecondsAndNanoseconds(1, 0),
3333
MemoryUsage::fromBytes(100),
3434
MemoryUsage::fromBytes(100),
35-
new GarbageCollectorStatus(0, 0, 0, 0, null, null, null, null, null, null, null, null)
35+
new GarbageCollectorStatus(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
3636
),
3737
Duration::fromSecondsAndNanoseconds(1, 0),
3838
MemoryUsage::fromBytes(100),

tests/Unit/Subscriber/Application/ApplicationStartedSubscriberTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function testNotify(): void
3333
HRTime::fromSecondsAndNanoseconds(1, 0),
3434
MemoryUsage::fromBytes(100),
3535
MemoryUsage::fromBytes(100),
36-
new GarbageCollectorStatus(0, 0, 0, 0, null, null, null, null, null, null, null, null)
36+
new GarbageCollectorStatus(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
3737
),
3838
Duration::fromSecondsAndNanoseconds(1, 0),
3939
MemoryUsage::fromBytes(100),

0 commit comments

Comments
 (0)