Skip to content

Commit 8c8aff7

Browse files
committed
added warning and unkown
1 parent 06830af commit 8c8aff7

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

src/PrettyPrinter.php

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use PHPUnit\Framework\TestFailure;
77
use PHPUnit\Framework\TestListener;
88
use PHPUnit\Framework\TestSuite;
9+
use PHPUnit\Runner\BaseTestRunner;
910
use PHPUnit\TextUI\ResultPrinter;
1011
use PHPUnit\Util\Filter;
1112

@@ -54,26 +55,30 @@ public function endTest(Test $test, float $time): void
5455
$this->write(' ');
5556

5657
switch ($test->getStatus()) {
57-
case 0:
58+
case BaseTestRunner::STATUS_PASSED:
5859
$this->writeWithColor('fg-green', $name, false);
5960
break;
60-
case 1:
61+
case BaseTestRunner::STATUS_SKIPPED:
6162
$this->writeWithColor('fg-yellow', $name, false);
6263
break;
63-
case 2:
64+
case BaseTestRunner::STATUS_INCOMPLETE:
6465
$this->writeWithColor('fg-blue', $name, false);
6566
break;
66-
case 3:
67+
case BaseTestRunner::STATUS_FAILURE:
6768
$this->writeWithColor('fg-red', $name, false);
6869
break;
69-
case 4:
70+
case BaseTestRunner::STATUS_ERROR:
7071
$this->writeWithColor('fg-red', $name, false);
7172
break;
72-
case 5:
73+
case BaseTestRunner::STATUS_RISKY:
7374
$this->writeWithColor('fg-magenta', $name, false);
7475
break;
76+
case BaseTestRunner::STATUS_WARNING:
77+
$this->writeWithColor('fg-yellow', $name, false);
78+
break;
79+
case BaseTestRunner::STATUS_UNKNOWN:
7580
default:
76-
$this->writeWithColor('fg-red', $name, false);
81+
$this->writeWithColor('fg-cyan', $name, false);
7782
break;
7883
}
7984

@@ -112,8 +117,11 @@ protected function writeProgress(string $progress): void
112117
case 'R':
113118
$this->writeWithColor('fg-magenta', '', false);
114119
break;
120+
case 'W':
121+
$this->writeWithColor('fg-yellow', ' ¤', false);
122+
break;
115123
default:
116-
$this->writeWithColor('fg-red', ' #', false);
124+
$this->writeWithColor('fg-cyan', ' ', false);
117125
break;
118126
}
119127
}

0 commit comments

Comments
 (0)