mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-02 14:25:38 +08:00
fix test result printer (#233)
This commit is contained in:
@@ -115,12 +115,13 @@ class ZMResultPrinter extends CliTestDoxPrinter
|
|||||||
|
|
||||||
protected function printFooter(TestResult $result): void
|
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';
|
$color = 'bg-green,fg-white,bold';
|
||||||
$text = '[OK] No errors';
|
$text = '[GOOD] All tests passed';
|
||||||
} else {
|
} else {
|
||||||
$color = 'bg-red,fg-white,bold';
|
$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} ");
|
$this->writeWithColor($color, "\n {$text} ");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user