Skip to content

Commit 93ff460

Browse files
PHPUnit 12 support
1 parent e1a3bce commit 93ff460

File tree

7 files changed

+1426
-890
lines changed

7 files changed

+1426
-890
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1404 additions & 884 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker-compose.yml

Lines changed: 10 additions & 0 deletions
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

Lines changed: 6 additions & 0 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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)