Skip to content

Commit bcc01d4

Browse files
Merge branch '10.5' into 11.5
2 parents 9398021 + aacde0d commit bcc01d4

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

ChangeLog-11.5.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ All notable changes of the PHPUnit 11.5 release series are documented in this fi
66

77
### Changed
88

9+
* [#6308](https://github.com/sebastianbergmann/phpunit/pull/6308): Improve output of `--check-php-configuration`
910
* The version number for the test result cache file has been incremented to reflect that its structure for PHPUnit 11.5 is not compatible with its structure for PHPUnit 8.5 and PHPUnit 9.6
1011

1112
### Fixed

src/TextUI/Command/Commands/CheckPhpConfigurationCommand.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,12 @@ public function execute(): Result
8787
}
8888
}
8989

90-
if (ini_get($name) === $setting['expectedValue']) {
90+
$actualValue = ini_get($name);
91+
92+
if ($actualValue === $setting['expectedValue']) {
9193
$check = $this->ok();
9294
} else {
93-
$check = $this->notOk();
95+
$check = $this->notOk($actualValue);
9496
$shellExitCode = 1;
9597
}
9698

@@ -143,14 +145,16 @@ private function ok(): string
143145
/**
144146
* @return non-empty-string
145147
*/
146-
private function notOk(): string
148+
private function notOk(string $actualValue): string
147149
{
150+
$message = sprintf('not ok (%s)', $actualValue);
151+
148152
if (!$this->colorize) {
149-
return 'not ok';
153+
return $message;
150154
}
151155

152156
// @codeCoverageIgnoreStart
153-
return Color::colorizeTextBox('fg-red, bold', 'not ok');
157+
return Color::colorizeTextBox('fg-red, bold', $message);
154158
// @codeCoverageIgnoreEnd
155159
}
156160
}

tests/end-to-end/check-php-configuration/failure-with-xdebug.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ PHPUnit %s by Sebastian Bergmann and contributors.
2626

2727
Checking whether PHP is configured according to https://docs.phpunit.de/en/%s/installation.html#configuring-php-for-development
2828

29-
display_errors = On ... not ok
29+
display_errors = On ... not ok (0)
3030
display_startup_errors = On ... ok
3131
error_reporting = -1 ... ok
3232
xdebug.show_exception_trace = 0 ... ok

tests/end-to-end/check-php-configuration/failure-without-xdebug.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ PHPUnit %s by Sebastian Bergmann and contributors.
2525

2626
Checking whether PHP is configured according to https://docs.phpunit.de/en/%s/installation.html#configuring-php-for-development
2727

28-
display_errors = On ... not ok
28+
display_errors = On ... not ok (0)
2929
display_startup_errors = On ... ok
3030
error_reporting = -1 ... ok
3131
zend.assertions = 1 ... ok

0 commit comments

Comments
 (0)