Skip to content

Commit 47ea0c4

Browse files
committed
Changed success progress indicator ('.') to be red exclamation mark ('!') after an error or failure occurs.
1 parent 5f5acdd commit 47ea0c4

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/Printer.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ protected function onStartTest()
5757
protected function writeProgress($progress)
5858
{
5959
// Record progress so it can be written later instead of at start of line.
60-
$this->progress = $this->flawless ? $progress : $this->formatWithColor('fg-red', $progress);
60+
$this->progress = !$this->flawless && $progress === '.'
61+
// If a previous error or exception occurred, replace '.' with red '!'.
62+
? $this->formatWithColor('fg-red', '!')
63+
: $progress
64+
;
6165

6266
++$this->numTestsRun;
6367
}

test/functional/success after failure.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ PHPUnit %s
1717

1818
%s%eCapabilitiesTest.php:%i
1919

20-
75% [31m.[0m [32;1mScriptFUSIONTest\PHPUnitImmediateExceptionPrinter\CapabilitiesTest::testSuccessAfterFailure with data set #2 (true)[0m[32m (%i ms)[0m
21-
100% [31m.[0m [32;1mScriptFUSIONTest\PHPUnitImmediateExceptionPrinter\CapabilitiesTest::testSuccessAfterFailure with data set #3 (true)[0m[32m (%i ms)[0m
20+
75% [31m![0m [32;1mScriptFUSIONTest\PHPUnitImmediateExceptionPrinter\CapabilitiesTest::testSuccessAfterFailure with data set #2 (true)[0m[32m (%i ms)[0m
21+
100% [31m![0m [32;1mScriptFUSIONTest\PHPUnitImmediateExceptionPrinter\CapabilitiesTest::testSuccessAfterFailure with data set #3 (true)[0m[32m (%i ms)[0m
2222

2323

2424
Time: %s

0 commit comments

Comments
 (0)