From 7258f8faf3bcdf14d04de579dd2d04b77f221baa Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Wed, 17 Jun 2020 11:25:53 +0200 Subject: [PATCH] Only print resource usage information when tests were run --- src/TextUI/ResultPrinter.php | 6 +----- .../end-to-end/filter-method-case-sensitive-no-result.phpt | 3 --- tests/end-to-end/filter-no-results.phpt | 3 --- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/TextUI/ResultPrinter.php b/src/TextUI/ResultPrinter.php index 51e6b7a7900..bbe72153ef5 100644 --- a/src/TextUI/ResultPrinter.php +++ b/src/TextUI/ResultPrinter.php @@ -390,13 +390,9 @@ protected function printSkipped(TestResult $result): void */ protected function printHeader(TestResult $result): void { - $this->write(\PHP_EOL); - if (\count($result) > 0) { - $this->write(\PHP_EOL); + $this->write(\PHP_EOL . \PHP_EOL . Timer::resourceUsage() . \PHP_EOL . \PHP_EOL); } - - $this->write(Timer::resourceUsage() . "\n\n"); } protected function printFooter(TestResult $result): void diff --git a/tests/end-to-end/filter-method-case-sensitive-no-result.phpt b/tests/end-to-end/filter-method-case-sensitive-no-result.phpt index 7557b2d70b1..f5d402b895a 100644 --- a/tests/end-to-end/filter-method-case-sensitive-no-result.phpt +++ b/tests/end-to-end/filter-method-case-sensitive-no-result.phpt @@ -12,7 +12,4 @@ PHPUnit\TextUI\Command::main(); --EXPECTF-- PHPUnit %s by Sebastian Bergmann and contributors. - -Time: %s, Memory: %s - No tests executed! diff --git a/tests/end-to-end/filter-no-results.phpt b/tests/end-to-end/filter-no-results.phpt index 2be2b99d676..4114870be5f 100644 --- a/tests/end-to-end/filter-no-results.phpt +++ b/tests/end-to-end/filter-no-results.phpt @@ -12,7 +12,4 @@ PHPUnit\TextUI\Command::main(); --EXPECTF-- PHPUnit %s by Sebastian Bergmann and contributors. - -Time: %s, Memory: %s - No tests executed!