diff --git a/src/Framework/TestCase.php b/src/Framework/TestCase.php index e08eed1d634..0e97269902b 100644 --- a/src/Framework/TestCase.php +++ b/src/Framework/TestCase.php @@ -744,6 +744,14 @@ final public function runBare(): void $this->invokeAfterClassHookMethods($hookMethods, $emitter); } } + } catch (AssertionError|AssertionFailedError $e) { + $this->status = TestStatus::failure($e->getMessage()); + + $emitter->testFailed( + $this->valueObjectForEvents(), + Event\Code\ThrowableBuilder::from($e), + Event\Code\ComparisonFailureBuilder::from($e), + ); } catch (Throwable $exceptionRaisedDuringTearDown) { if (!isset($e)) { $this->status = TestStatus::error($exceptionRaisedDuringTearDown->getMessage());