From 2c32e9b8db173eaa8736dfddc9655567519ef847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Kr=C3=A4mer?= Date: Sun, 14 Dec 2025 01:09:15 +0100 Subject: [PATCH] Update README and ExecutionTimeReportPrinter for improved test output formatting - Changed code block syntax in README to `text` for better readability. - Enhanced the display format of slowest tests in README to include a timer icon. - Adjusted spacing in the `ExecutionTimeReportPrinter` for consistent output formatting. --- README.md | 8 ++++---- .../ExecutionTimeReportPrinter.php | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 08fb666..c8ed70c 100644 --- a/README.md +++ b/README.md @@ -57,12 +57,12 @@ After running your tests, you'll see a summary report at the end showing the slo - **Red**: Tests that exceed the danger threshold (default: 5 seconds) - **Normal**: Tests below the warning threshold -``` +```text Top 10 slowest tests: - 1. MyTest::testSlowOperation : 1234.56 ms (1.235 s) [colored red] - 2. AnotherTest::testComplexCalculation : 987.65 ms (0.988 s) [colored yellow] - 3. DatabaseTest::testLargeQuery : 654.32 ms (0.654 s) [colored yellow] + 1. ⏱ 1234.56 ms (1.235 s) MyTest::testSlowOperation [colored red] + 2. ⏱ 987.65 ms (0.988 s) AnotherTest::testComplexCalculation [colored yellow] + 3. ⏱ 654.32 ms (0.654 s) DatabaseTest::testLargeQuery [colored yellow] ... ``` diff --git a/src/ExecutionTimingExtension/ExecutionTimeReportPrinter.php b/src/ExecutionTimingExtension/ExecutionTimeReportPrinter.php index c2479e0..7373e9e 100644 --- a/src/ExecutionTimingExtension/ExecutionTimeReportPrinter.php +++ b/src/ExecutionTimingExtension/ExecutionTimeReportPrinter.php @@ -45,8 +45,6 @@ public function print(): void $this->printHeader(count($topTests)); $this->printTestLines($topTests); - - echo PHP_EOL; } private function shouldPrint(): bool @@ -142,7 +140,7 @@ private function printTestLine(array $test, int $rank, array $columnWidths): voi $timeSecDisplay = $color !== '' ? Color::colorize($color, $timeSecFormatted) : $timeSecFormatted; printf( - " %s. ⏱ %s %s %s" . PHP_EOL, + " %s. ⏱ %s %s %s" . PHP_EOL, $rankFormatted, $timeMsDisplay, $timeSecDisplay,