Skip to content

Commit

Permalink
Merge pull request #33 from ergebnis/fix/new
Browse files Browse the repository at this point in the history
Fix: Avoid trailing new lines in report
  • Loading branch information
ergebnis-bot authored Jan 25, 2021
2 parents 838b1b4 + 9260791 commit 3b019a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/Reporter/DefaultReporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ public function report(SlowTest ...$slowTests): string
$list = $this->list(...$slowTests);
$footer = $this->footer(...$slowTests);

if ('' === $footer) {
return <<<TXT
{$header}
{$list}
TXT;
}

return <<<TXT
{$header}
{$list}
Expand Down
2 changes: 0 additions & 2 deletions test/Unit/Reporter/DefaultReporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ public function testReportReturnsReportWhenTheNumberOfSlowTestsIsSmallerThanTheM
3,456 ms: Ergebnis\PHPUnit\SlowTestDetector\Test\Example\SleeperTest::qux
1,234 ms: Ergebnis\PHPUnit\SlowTestDetector\Test\Example\SleeperTest::quz
123 ms: Ergebnis\PHPUnit\SlowTestDetector\Test\Example\SleeperTest::baz with dataset "string"

TXT;

self::assertSame($expected, $report);
Expand Down Expand Up @@ -259,7 +258,6 @@ public function testReportReturnsReportWhenTheNumberOfSlowTestsIsEqualToTheMaxim
3,456 ms: Ergebnis\PHPUnit\SlowTestDetector\Test\Example\SleeperTest::qux
1,234 ms: Ergebnis\PHPUnit\SlowTestDetector\Test\Example\SleeperTest::quz
123 ms: Ergebnis\PHPUnit\SlowTestDetector\Test\Example\SleeperTest::baz with dataset "string"

TXT;

self::assertSame($expected, $report);
Expand Down

0 comments on commit 3b019a0

Please sign in to comment.