mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-17 12:44:51 +08:00
fix test result printer (#233)
This commit is contained in:
parent
690f8aed10
commit
0c13cded89
@ -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} ");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user