diff --git a/ChangeLog-10.0.md b/ChangeLog-10.0.md index 01154d1f342..951d4b208ca 100644 --- a/ChangeLog-10.0.md +++ b/ChangeLog-10.0.md @@ -7,6 +7,7 @@ All notable changes of the PHPUnit 10.0 release series are documented in this fi ### Fixed * [#5270](https://github.com/sebastianbergmann/phpunit/issues/5270): `GlobalState::getIniSettingsAsString()` generates code that triggers warnings +* [#5291](https://github.com/sebastianbergmann/phpunit/pull/5291): Test Runner exits with wrong shell exit code after a PHPUnit error occurred ## [10.0.18] - 2023-03-22 diff --git a/src/TextUI/ShellExitCodeCalculator.php b/src/TextUI/ShellExitCodeCalculator.php index 2932c7d224c..4e88be8942f 100644 --- a/src/TextUI/ShellExitCodeCalculator.php +++ b/src/TextUI/ShellExitCodeCalculator.php @@ -50,7 +50,7 @@ public function calculate(bool $failOnEmptyTestSuite, bool $failOnRisky, bool $f } } - if ($result->hasTestErroredEvents()) { + if ($result->hasTestErroredEvents() || $result->hasTestTriggeredPhpunitErrorEvents()) { $returnCode = self::EXCEPTION_EXIT; } diff --git a/tests/end-to-end/event/empty-data-provider.phpt b/tests/end-to-end/event/empty-data-provider.phpt index 14359d0a1f2..86b5d0f3af3 100644 --- a/tests/end-to-end/event/empty-data-provider.phpt +++ b/tests/end-to-end/event/empty-data-provider.phpt @@ -38,4 +38,4 @@ Test Suite Sorted Test Runner Execution Started (0 tests) Test Runner Execution Finished Test Runner Finished -PHPUnit Finished (Shell Exit Code: 1) +PHPUnit Finished (Shell Exit Code: 2) diff --git a/tests/end-to-end/event/exception-in-data-provider.phpt b/tests/end-to-end/event/exception-in-data-provider.phpt index 38a040c4b2e..0ba729cf59f 100644 --- a/tests/end-to-end/event/exception-in-data-provider.phpt +++ b/tests/end-to-end/event/exception-in-data-provider.phpt @@ -38,4 +38,4 @@ Test Suite Sorted Test Runner Execution Started (0 tests) Test Runner Execution Finished Test Runner Finished -PHPUnit Finished (Shell Exit Code: 1) +PHPUnit Finished (Shell Exit Code: 2) diff --git a/tests/end-to-end/event/invalid-data-provider-with-passing-test.phpt b/tests/end-to-end/event/invalid-data-provider-with-passing-test.phpt index ea4f3397988..239dbcf7a68 100644 --- a/tests/end-to-end/event/invalid-data-provider-with-passing-test.phpt +++ b/tests/end-to-end/event/invalid-data-provider-with-passing-test.phpt @@ -44,4 +44,4 @@ Test Finished (PHPUnit\TestFixture\Event\InvalidDataProviderWithOneTestPassingTe Test Suite Finished (PHPUnit\TestFixture\Event\InvalidDataProviderWithOneTestPassingTest, 1 test) Test Runner Execution Finished Test Runner Finished -PHPUnit Finished (Shell Exit Code: 1) +PHPUnit Finished (Shell Exit Code: 2) diff --git a/tests/end-to-end/event/invalid-data-provider.phpt b/tests/end-to-end/event/invalid-data-provider.phpt index 27d029bacb4..4d196220e5f 100644 --- a/tests/end-to-end/event/invalid-data-provider.phpt +++ b/tests/end-to-end/event/invalid-data-provider.phpt @@ -38,4 +38,4 @@ Test Suite Sorted Test Runner Execution Started (0 tests) Test Runner Execution Finished Test Runner Finished -PHPUnit Finished (Shell Exit Code: 1) +PHPUnit Finished (Shell Exit Code: 2)