Skip to content

Commit 4797b62

Browse files
now jsut giving a total of skipped tests
1 parent 9a8678f commit 4797b62

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

src/PHPUnit/TestDox/CliTestDoxPrinter.php

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,19 @@
2626
*/
2727
class CliTestDoxPrinter extends ResultPrinter
2828
{
29+
private const SYMBOL_SKIP = '';
2930
/**
3031
* @var \EdmondsCommerce\PHPQA\PHPUnit\TestDox\TestResult
3132
*/
3233
private $currentTestResult;
33-
3434
/**
3535
* @var \EdmondsCommerce\PHPQA\PHPUnit\TestDox\TestResult
3636
*/
3737
private $previousTestResult;
38-
3938
/**
4039
* @var \EdmondsCommerce\PHPQA\PHPUnit\TestDox\TestResult[]
4140
*/
4241
private $nonSuccessfulTestResults = [];
43-
4442
/**
4543
* @var NamePrettifier
4644
*/
@@ -179,12 +177,13 @@ public function addRiskyTest(Test $test, \Throwable $t, float $time): void
179177
public function addSkippedTest(Test $test, \Throwable $t, float $time): void
180178
{
181179
$this->currentTestResult->fail(
182-
$this->formatWithColor('fg-yellow', ''),
180+
$this->formatWithColor('fg-yellow', self::SYMBOL_SKIP),
183181
(string)$t,
184182
true
185183
);
186184
}
187185

186+
188187
public function writeProgress(string $progress): void
189188
{
190189
}
@@ -219,14 +218,34 @@ private function printNonSuccessfulTestsSummary(int $numberOfExecutedTests): voi
219218
return;
220219
}
221220

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+
);
223228

224229
$previousTestResult = null;
225230

231+
$skippedTests = 0;
226232
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);
228239

229240
$previousTestResult = $testResult;
230241
}
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+
}
231250
}
232251
}

0 commit comments

Comments
 (0)