From 0c13cded892c841434ace076c38dbc65182568ae Mon Sep 17 00:00:00 2001 From: sunxyw <31698606+sunxyw@users.noreply.github.com> Date: Wed, 4 Jan 2023 13:45:48 +0800 Subject: [PATCH] fix test result printer (#233) --- tests/ZMResultPrinter.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/ZMResultPrinter.php b/tests/ZMResultPrinter.php index dbfa7687..85bb5fc5 100644 --- a/tests/ZMResultPrinter.php +++ b/tests/ZMResultPrinter.php @@ -115,12 +115,13 @@ class ZMResultPrinter extends CliTestDoxPrinter protected function printFooter(TestResult $result): void { - if ($result->failureCount() === 0) { + $non_passed = $result->failureCount() + $result->errorCount() + $result->warningCount(); + if ($non_passed === 0) { $color = 'bg-green,fg-white,bold'; - $text = '[OK] No errors'; + $text = '[GOOD] All tests passed'; } else { $color = 'bg-red,fg-white,bold'; - $text = '[ERROR] Found ' . $result->failureCount() . ' failures'; + $text = '[FAIL] Found ' . $non_passed . ' non-passed tests'; } $this->writeWithColor($color, "\n {$text} "); }