|
26 | 26 | */ |
27 | 27 | class CliTestDoxPrinter extends ResultPrinter |
28 | 28 | { |
| 29 | + private const SYMBOL_SKIP = '→'; |
29 | 30 | /** |
30 | 31 | * @var \EdmondsCommerce\PHPQA\PHPUnit\TestDox\TestResult |
31 | 32 | */ |
32 | 33 | private $currentTestResult; |
33 | | - |
34 | 34 | /** |
35 | 35 | * @var \EdmondsCommerce\PHPQA\PHPUnit\TestDox\TestResult |
36 | 36 | */ |
37 | 37 | private $previousTestResult; |
38 | | - |
39 | 38 | /** |
40 | 39 | * @var \EdmondsCommerce\PHPQA\PHPUnit\TestDox\TestResult[] |
41 | 40 | */ |
42 | 41 | private $nonSuccessfulTestResults = []; |
43 | | - |
44 | 42 | /** |
45 | 43 | * @var NamePrettifier |
46 | 44 | */ |
@@ -179,12 +177,13 @@ public function addRiskyTest(Test $test, \Throwable $t, float $time): void |
179 | 177 | public function addSkippedTest(Test $test, \Throwable $t, float $time): void |
180 | 178 | { |
181 | 179 | $this->currentTestResult->fail( |
182 | | - $this->formatWithColor('fg-yellow', '→'), |
| 180 | + $this->formatWithColor('fg-yellow', self::SYMBOL_SKIP), |
183 | 181 | (string)$t, |
184 | 182 | true |
185 | 183 | ); |
186 | 184 | } |
187 | 185 |
|
| 186 | + |
188 | 187 | public function writeProgress(string $progress): void |
189 | 188 | { |
190 | 189 | } |
@@ -219,14 +218,34 @@ private function printNonSuccessfulTestsSummary(int $numberOfExecutedTests): voi |
219 | 218 | return; |
220 | 219 | } |
221 | 220 |
|
222 | | - $this->write("Summary of non-successful tests:\n\n"); |
| 221 | + $this->write( |
| 222 | + $this->formatWithColor( |
| 223 | + 'fg-yellow', |
| 224 | + "Summary of non-successful tests:" |
| 225 | + ) |
| 226 | + . "\n\n" |
| 227 | + ); |
223 | 228 |
|
224 | 229 | $previousTestResult = null; |
225 | 230 |
|
| 231 | + $skippedTests = 0; |
226 | 232 | foreach ($this->nonSuccessfulTestResults as $testResult) { |
227 | | - $this->write($testResult->toString($previousTestResult, $this->verbose)); |
| 233 | + $line = $testResult->toString($previousTestResult, $this->verbose); |
| 234 | + if (false !== \strpos($line, self::SYMBOL_SKIP)) { |
| 235 | + $skippedTests++; |
| 236 | + continue; |
| 237 | + } |
| 238 | + $this->write($line); |
228 | 239 |
|
229 | 240 | $previousTestResult = $testResult; |
230 | 241 | } |
| 242 | + if ($skippedTests > 0) { |
| 243 | + $this->write( |
| 244 | + $this->formatWithColor( |
| 245 | + 'fg-yellow', |
| 246 | + "\n" . self::SYMBOL_SKIP . ' Skipped Tests: ' . $skippedTests . "\n\n" |
| 247 | + ) |
| 248 | + ); |
| 249 | + } |
231 | 250 | } |
232 | 251 | } |
0 commit comments