@@ -52,7 +52,31 @@ public function endTest(Test $test, float $time): void
52
52
}
53
53
54
54
$ this ->write (' ' );
55
- $ this ->writeWithColor ($ color , $ name , false );
55
+
56
+ switch ($ test ->getStatus ()) {
57
+ case 0 :
58
+ $ this ->writeWithColor ('fg-green ' , $ name , false );
59
+ break ;
60
+ case 1 :
61
+ $ this ->writeWithColor ('fg-yellow ' , $ name , false );
62
+ break ;
63
+ case 2 :
64
+ $ this ->writeWithColor ('fg-blue ' , $ name , false );
65
+ break ;
66
+ case 3 :
67
+ $ this ->writeWithColor ('fg-red ' , $ name , false );
68
+ break ;
69
+ case 4 :
70
+ $ this ->writeWithColor ('fg-red ' , $ name , false );
71
+ break ;
72
+ case 5 :
73
+ $ this ->writeWithColor ('fg-magenta ' , $ name , false );
74
+ break ;
75
+ default :
76
+ $ this ->writeWithColor ('fg-red ' , $ name , false );
77
+ break ;
78
+ }
79
+
56
80
$ this ->write (' ' );
57
81
58
82
$ timeColor = $ time > 0.5 ? 'fg-yellow ' : 'fg-white ' ;
@@ -69,10 +93,28 @@ protected function writeProgress(string $progress): void
69
93
70
94
$ this ->previousClassName = $ this ->className ;
71
95
72
- if ($ progress == '. ' ) {
73
- $ this ->writeWithColor ('fg-green ' , ' ✓ ' , false );
74
- } else {
75
- $ this ->writeWithColor ('fg-red ' , ' x ' , false );
96
+ switch (strtoupper (preg_replace ('# \\x1b[[][^A-Za-z]*[A-Za-z]# ' , '' , $ progress ))) {
97
+ case '. ' :
98
+ $ this ->writeWithColor ('fg-green ' , ' ✓ ' , false );
99
+ break ;
100
+ case 'S ' :
101
+ $ this ->writeWithColor ('fg-yellow ' , ' → ' , false );
102
+ break ;
103
+ case 'I ' :
104
+ $ this ->writeWithColor ('fg-blue ' , ' ∅ ' , false );
105
+ break ;
106
+ case 'F ' :
107
+ $ this ->writeWithColor ('fg-red ' , ' x ' , false );
108
+ break ;
109
+ case 'E ' :
110
+ $ this ->writeWithColor ('fg-red ' , ' ⚈ ' , false );
111
+ break ;
112
+ case 'R ' :
113
+ $ this ->writeWithColor ('fg-magenta ' , ' ⌽ ' , false );
114
+ break ;
115
+ default :
116
+ $ this ->writeWithColor ('fg-red ' , ' # ' , false );
117
+ break ;
76
118
}
77
119
}
78
120
0 commit comments