Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
56 changes: 28 additions & 28 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -331,74 +331,74 @@ parameters:
path: test/Unit/PhaseTest.php

-
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\ColorTest\\:\\:testDimReturnsDimmedStringWhenItIsNotWhitespaceOnly\\(\\) has no return type specified\\.$#"
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Console\\\\ColorTest\\:\\:testDimReturnsDimmedStringWhenItIsNotWhitespaceOnly\\(\\) has no return type specified\\.$#"
count: 1
path: test/Unit/Reporter/ColorTest.php
path: test/Unit/Reporter/Console/ColorTest.php

-
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\ColorTest\\:\\:testDimReturnsOriginalStringWhenItIsWhitespaceOnly\\(\\) has no return type specified\\.$#"
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Console\\\\ColorTest\\:\\:testDimReturnsOriginalStringWhenItIsWhitespaceOnly\\(\\) has no return type specified\\.$#"
count: 1
path: test/Unit/Reporter/ColorTest.php
path: test/Unit/Reporter/Console/ColorTest.php

-
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\ConsoleReporterTest\\:\\:testReportReturnsEmptyStringWhenSlowTestListIsEmpty\\(\\) has no return type specified\\.$#"
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Console\\\\ConsoleReporterTest\\:\\:testReportReturnsEmptyStringWhenSlowTestListIsEmpty\\(\\) has no return type specified\\.$#"
count: 1
path: test/Unit/Reporter/ConsoleReporterTest.php
path: test/Unit/Reporter/Console/ConsoleReporterTest.php

-
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\ConsoleReporterTest\\:\\:testReportReturnsReportWhenSlowTestListHasFewerSlowTestsThanMaximumCount\\(\\) has no return type specified\\.$#"
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Console\\\\ConsoleReporterTest\\:\\:testReportReturnsReportWhenSlowTestListHasFewerSlowTestsThanMaximumCount\\(\\) has no return type specified\\.$#"
count: 1
path: test/Unit/Reporter/ConsoleReporterTest.php
path: test/Unit/Reporter/Console/ConsoleReporterTest.php

-
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Formatter\\\\DefaultDurationFormatterTest\\:\\:testFormatFormats\\(\\) has no return type specified\\.$#"
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Console\\\\DefaultDurationFormatterTest\\:\\:testFormatFormats\\(\\) has no return type specified\\.$#"
count: 1
path: test/Unit/Reporter/Formatter/DefaultDurationFormatterTest.php
path: test/Unit/Reporter/Console/DefaultDurationFormatterTest.php

-
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Formatter\\\\UnitTest\\:\\:testEqualsReturnsFalseWhenUnitsAreNotEqual\\(\\) has no return type specified\\.$#"
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Console\\\\UnitTest\\:\\:testEqualsReturnsFalseWhenUnitsAreNotEqual\\(\\) has no return type specified\\.$#"
count: 1
path: test/Unit/Reporter/Formatter/UnitTest.php
path: test/Unit/Reporter/Console/UnitTest.php

-
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Formatter\\\\UnitTest\\:\\:testEqualsReturnsTrueWhenUnitsAreEqual\\(\\) has no return type specified\\.$#"
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Console\\\\UnitTest\\:\\:testEqualsReturnsTrueWhenUnitsAreEqual\\(\\) has no return type specified\\.$#"
count: 1
path: test/Unit/Reporter/Formatter/UnitTest.php
path: test/Unit/Reporter/Console/UnitTest.php

-
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Formatter\\\\UnitTest\\:\\:testFromDurationReturnsExpectedUnit\\(\\) has no return type specified\\.$#"
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Console\\\\UnitTest\\:\\:testFromDurationReturnsExpectedUnit\\(\\) has no return type specified\\.$#"
count: 1
path: test/Unit/Reporter/Formatter/UnitTest.php
path: test/Unit/Reporter/Console/UnitTest.php

-
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Formatter\\\\UnitTest\\:\\:testFromDurationsReturnsLargestUnit\\(\\) has no return type specified\\.$#"
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Console\\\\UnitTest\\:\\:testFromDurationsReturnsLargestUnit\\(\\) has no return type specified\\.$#"
count: 1
path: test/Unit/Reporter/Formatter/UnitTest.php
path: test/Unit/Reporter/Console/UnitTest.php

-
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Formatter\\\\UnitTest\\:\\:testHoursReturnsUnit\\(\\) has no return type specified\\.$#"
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Console\\\\UnitTest\\:\\:testHoursReturnsUnit\\(\\) has no return type specified\\.$#"
count: 1
path: test/Unit/Reporter/Formatter/UnitTest.php
path: test/Unit/Reporter/Console/UnitTest.php

-
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Formatter\\\\UnitTest\\:\\:testIsGreaterThanReturnsFalseWhenUnitIsNotGreater\\(\\) has no return type specified\\.$#"
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Console\\\\UnitTest\\:\\:testIsGreaterThanReturnsFalseWhenUnitIsNotGreater\\(\\) has no return type specified\\.$#"
count: 1
path: test/Unit/Reporter/Formatter/UnitTest.php
path: test/Unit/Reporter/Console/UnitTest.php

-
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Formatter\\\\UnitTest\\:\\:testIsGreaterThanReturnsTrueWhenUnitIsGreater\\(\\) has no return type specified\\.$#"
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Console\\\\UnitTest\\:\\:testIsGreaterThanReturnsTrueWhenUnitIsGreater\\(\\) has no return type specified\\.$#"
count: 1
path: test/Unit/Reporter/Formatter/UnitTest.php
path: test/Unit/Reporter/Console/UnitTest.php

-
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Formatter\\\\UnitTest\\:\\:testMinutesReturnsUnit\\(\\) has no return type specified\\.$#"
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Console\\\\UnitTest\\:\\:testMinutesReturnsUnit\\(\\) has no return type specified\\.$#"
count: 1
path: test/Unit/Reporter/Formatter/UnitTest.php
path: test/Unit/Reporter/Console/UnitTest.php

-
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Formatter\\\\UnitTest\\:\\:testSecondsReturnsUnit\\(\\) has no return type specified\\.$#"
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\Reporter\\\\Console\\\\UnitTest\\:\\:testSecondsReturnsUnit\\(\\) has no return type specified\\.$#"
count: 1
path: test/Unit/Reporter/Formatter/UnitTest.php
path: test/Unit/Reporter/Console/UnitTest.php

-
message: "#^Method Ergebnis\\\\PHPUnit\\\\SlowTestDetector\\\\Test\\\\Unit\\\\SlowTestListTest\\:\\:testCountReturnsCountOfSlowTests\\(\\) has no return type specified\\.$#"
Expand Down
12 changes: 6 additions & 6 deletions src/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public function __construct(array $options = [])

$this->maximumDuration = $maximumDuration;
$this->collector = new Collector\DefaultCollector();
$this->reporter = new Reporter\ConsoleReporter(
new Reporter\Formatter\DefaultDurationFormatter(),
$this->reporter = new Reporter\Console\ConsoleReporter(
new Reporter\Console\DefaultDurationFormatter(),
$maximumDuration,
$maximumCount
);
Expand Down Expand Up @@ -271,8 +271,8 @@ public function __construct(array $options = [])

$this->maximumDuration = $maximumDuration;
$this->collector = new Collector\DefaultCollector();
$this->reporter = new Reporter\ConsoleReporter(
new Reporter\Formatter\DefaultDurationFormatter(),
$this->reporter = new Reporter\Console\ConsoleReporter(
new Reporter\Console\DefaultDurationFormatter(),
$maximumDuration,
$maximumCount
);
Expand Down Expand Up @@ -442,8 +442,8 @@ public function bootstrap(

$timeKeeper = new TimeKeeper();
$collector = new Collector\DefaultCollector();
$reporter = new Reporter\ConsoleReporter(
new Reporter\Formatter\DefaultDurationFormatter(),
$reporter = new Reporter\Console\ConsoleReporter(
new Reporter\Console\DefaultDurationFormatter(),
$maximumDuration,
$maximumCount
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @see https://github.com/ergebnis/phpunit-slow-test-detector
*/

namespace Ergebnis\PHPUnit\SlowTestDetector\Reporter;
namespace Ergebnis\PHPUnit\SlowTestDetector\Reporter\Console;

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
* @see https://github.com/ergebnis/phpunit-slow-test-detector
*/

namespace Ergebnis\PHPUnit\SlowTestDetector\Reporter;
namespace Ergebnis\PHPUnit\SlowTestDetector\Reporter\Console;

use Ergebnis\PHPUnit\SlowTestDetector\Count;
use Ergebnis\PHPUnit\SlowTestDetector\Duration;
use Ergebnis\PHPUnit\SlowTestDetector\MaximumCount;
use Ergebnis\PHPUnit\SlowTestDetector\MaximumDuration;
use Ergebnis\PHPUnit\SlowTestDetector\Reporter\Reporter;
use Ergebnis\PHPUnit\SlowTestDetector\SlowTest;
use Ergebnis\PHPUnit\SlowTestDetector\SlowTestList;

Expand All @@ -26,7 +27,7 @@
final class ConsoleReporter implements Reporter
{
/**
* @var Formatter\DurationFormatter
* @var \Ergebnis\PHPUnit\SlowTestDetector\Reporter\Console\DurationFormatter
*/
private $durationFormatter;

Expand All @@ -41,7 +42,7 @@ final class ConsoleReporter implements Reporter
private $maximumCount;

public function __construct(
Formatter\DurationFormatter $durationFormatter,
\Ergebnis\PHPUnit\SlowTestDetector\Reporter\Console\DurationFormatter $durationFormatter,
MaximumDuration $maximumDuration,
MaximumCount $maximumCount
) {
Expand Down Expand Up @@ -108,7 +109,7 @@ private function reportWithCustomAndGlobalMaximumDuration(

yield '';

$unit = Formatter\Unit::fromDurations(
$unit = \Ergebnis\PHPUnit\SlowTestDetector\Reporter\Console\Unit::fromDurations(
$this->maximumDuration->toDuration(),
...\array_merge(
\array_map(static function (SlowTest $slowTest): Duration {
Expand Down Expand Up @@ -237,7 +238,7 @@ private function reportWithGlobalMaximumDuration(

yield '';

$unit = Formatter\Unit::fromDurations(
$unit = \Ergebnis\PHPUnit\SlowTestDetector\Reporter\Console\Unit::fromDurations(
$this->maximumDuration->toDuration(),
...\array_map(static function (SlowTest $slowTest): Duration {
return $slowTest->duration();
Expand Down Expand Up @@ -320,7 +321,7 @@ private function reportWithGlobalMaximumDuration(
}

private function durationColumnWidth(
Formatter\Unit $unit,
\Ergebnis\PHPUnit\SlowTestDetector\Reporter\Console\Unit $unit,
Duration ...$durations
): int {
return \max(
Expand All @@ -338,7 +339,7 @@ private function durationColumnWidth(
* @return \Generator<int, string>
*/
private function legend(
Formatter\Unit $unit,
\Ergebnis\PHPUnit\SlowTestDetector\Reporter\Console\Unit $unit,
int $columnStart,
int $columnWidth
): \Generator {
Expand All @@ -359,7 +360,7 @@ private function legend(

yield $padding . $durationOfZeroFormatted;

if ($unit->equals(Formatter\Unit::hours())) {
if ($unit->equals(\Ergebnis\PHPUnit\SlowTestDetector\Reporter\Console\Unit::hours())) {
yield $padding . ' │ │ └─── seconds';

yield $padding . ' │ └────── minutes';
Expand All @@ -369,7 +370,7 @@ private function legend(
return;
}

if ($unit->equals(Formatter\Unit::minutes())) {
if ($unit->equals(\Ergebnis\PHPUnit\SlowTestDetector\Reporter\Console\Unit::minutes())) {
yield $padding . ' │ └─── seconds';

yield $padding . ' └────── minutes';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @see https://github.com/ergebnis/phpunit-slow-test-detector
*/

namespace Ergebnis\PHPUnit\SlowTestDetector\Reporter\Formatter;
namespace Ergebnis\PHPUnit\SlowTestDetector\Reporter\Console;

use Ergebnis\PHPUnit\SlowTestDetector\Duration;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @see https://github.com/ergebnis/phpunit-slow-test-detector
*/

namespace Ergebnis\PHPUnit\SlowTestDetector\Reporter\Formatter;
namespace Ergebnis\PHPUnit\SlowTestDetector\Reporter\Console;

use Ergebnis\PHPUnit\SlowTestDetector\Duration;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @see https://github.com/ergebnis/phpunit-slow-test-detector
*/

namespace Ergebnis\PHPUnit\SlowTestDetector\Reporter\Formatter;
namespace Ergebnis\PHPUnit\SlowTestDetector\Reporter\Console;

use Ergebnis\PHPUnit\SlowTestDetector\Duration;

Expand Down
64 changes: 0 additions & 64 deletions test/EndToEnd/PHPUnit06/Configuration/Defaults/SleeperTest.php

This file was deleted.

26 changes: 0 additions & 26 deletions test/EndToEnd/PHPUnit06/Configuration/Defaults/phpunit.xml

This file was deleted.

41 changes: 0 additions & 41 deletions test/EndToEnd/PHPUnit06/Configuration/Defaults/test.phpt

This file was deleted.

Loading