Skip to content

Commit 3dc7df7

Browse files
Closes #5493
Co-authored-by: Sebastian Bergmann <sb@sebastian-bergmann.de> Co-authored-by: Arne Blankerts <Arne@Blankerts.de>
1 parent d672652 commit 3dc7df7

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

ChangeLog-10.3.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ All notable changes of the PHPUnit 10.3 release series are documented in this fi
88

99
* The child processes used for process isolation now use temporary files to communicate their result to the parent process
1010

11+
### Fixed
12+
13+
* [#5493](https://github.com/sebastianbergmann/phpunit/issues/5493): Assertion failures during setup swallows test outcome
14+
1115
## [10.3.4] - 2023-09-12
1216

1317
### Changed

src/Framework/TestCase.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,10 @@ final public function runBare(): void
671671
$e->getMessage(),
672672
);
673673
} catch (AssertionError|AssertionFailedError $e) {
674+
if (!$this->wasPrepared) {
675+
$this->wasPrepared = true;
676+
}
677+
674678
$this->status = TestStatus::failure($e->getMessage());
675679

676680
$emitter->testFailed(

tests/end-to-end/regression/5493.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
--TEST--
22
https://github.com/sebastianbergmann/phpunit/issues/5493
3-
--XFAIL--
4-
https://github.com/sebastianbergmann/phpunit/issues/5493
53
--FILE--
64
<?php declare(strict_types=1);
75
$_SERVER['argv'][] = '--do-not-cache-result';

0 commit comments

Comments
 (0)