diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 26f2887af..db059d49f 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -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\\.$#" diff --git a/src/Extension.php b/src/Extension.php index 1ccdc1931..4dc310e19 100644 --- a/src/Extension.php +++ b/src/Extension.php @@ -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 ); @@ -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 ); @@ -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 ); diff --git a/src/Reporter/Color.php b/src/Reporter/Console/Color.php similarity index 91% rename from src/Reporter/Color.php rename to src/Reporter/Console/Color.php index b58f4e301..67707068c 100644 --- a/src/Reporter/Color.php +++ b/src/Reporter/Console/Color.php @@ -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 diff --git a/src/Reporter/ConsoleReporter.php b/src/Reporter/Console/ConsoleReporter.php similarity index 93% rename from src/Reporter/ConsoleReporter.php rename to src/Reporter/Console/ConsoleReporter.php index b8545b170..aabe02c93 100644 --- a/src/Reporter/ConsoleReporter.php +++ b/src/Reporter/Console/ConsoleReporter.php @@ -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; @@ -26,7 +27,7 @@ final class ConsoleReporter implements Reporter { /** - * @var Formatter\DurationFormatter + * @var \Ergebnis\PHPUnit\SlowTestDetector\Reporter\Console\DurationFormatter */ private $durationFormatter; @@ -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 ) { @@ -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 { @@ -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(); @@ -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( @@ -338,7 +339,7 @@ private function durationColumnWidth( * @return \Generator */ private function legend( - Formatter\Unit $unit, + \Ergebnis\PHPUnit\SlowTestDetector\Reporter\Console\Unit $unit, int $columnStart, int $columnWidth ): \Generator { @@ -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'; @@ -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'; diff --git a/src/Reporter/Formatter/DefaultDurationFormatter.php b/src/Reporter/Console/DefaultDurationFormatter.php similarity index 96% rename from src/Reporter/Formatter/DefaultDurationFormatter.php rename to src/Reporter/Console/DefaultDurationFormatter.php index 57989a9cd..dc07bf11c 100644 --- a/src/Reporter/Formatter/DefaultDurationFormatter.php +++ b/src/Reporter/Console/DefaultDurationFormatter.php @@ -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; diff --git a/src/Reporter/Formatter/DurationFormatter.php b/src/Reporter/Console/DurationFormatter.php similarity index 88% rename from src/Reporter/Formatter/DurationFormatter.php rename to src/Reporter/Console/DurationFormatter.php index 3a43421bc..eba3a5270 100644 --- a/src/Reporter/Formatter/DurationFormatter.php +++ b/src/Reporter/Console/DurationFormatter.php @@ -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; diff --git a/src/Reporter/Formatter/Unit.php b/src/Reporter/Console/Unit.php similarity index 96% rename from src/Reporter/Formatter/Unit.php rename to src/Reporter/Console/Unit.php index 95a1dd009..05cfc3345 100644 --- a/src/Reporter/Formatter/Unit.php +++ b/src/Reporter/Console/Unit.php @@ -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; diff --git a/test/EndToEnd/PHPUnit06/Configuration/Defaults/SleeperTest.php b/test/EndToEnd/PHPUnit06/Configuration/Defaults/SleeperTest.php deleted file mode 100644 index 2244712e1..000000000 --- a/test/EndToEnd/PHPUnit06/Configuration/Defaults/SleeperTest.php +++ /dev/null @@ -1,64 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanDefaultMaximumDuration - */ - public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds) - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): \Generator - { - $values = \range( - 600, - 1600, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit06/Configuration/Defaults/phpunit.xml b/test/EndToEnd/PHPUnit06/Configuration/Defaults/phpunit.xml deleted file mode 100644 index 55fa61376..000000000 --- a/test/EndToEnd/PHPUnit06/Configuration/Defaults/phpunit.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/Configuration/Defaults/test.phpt b/test/EndToEnd/PHPUnit06/Configuration/Defaults/test.phpt deleted file mode 100644 index 0fee91c3e..000000000 --- a/test/EndToEnd/PHPUnit06/Configuration/Defaults/test.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -With default configuration ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanDefaultMaximumDuration - */ - public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds) - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): \Generator - { - $values = \range( - 600, - 1000, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit06/Configuration/MaximumCount/phpunit.xml b/test/EndToEnd/PHPUnit06/Configuration/MaximumCount/phpunit.xml deleted file mode 100644 index b0f77e722..000000000 --- a/test/EndToEnd/PHPUnit06/Configuration/MaximumCount/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 3 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/Configuration/MaximumCount/test.phpt b/test/EndToEnd/PHPUnit06/Configuration/MaximumCount/test.phpt deleted file mode 100644 index e7d5152d9..000000000 --- a/test/EndToEnd/PHPUnit06/Configuration/MaximumCount/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With custom configuration setting the "maximum-count" parameter in the XML configuration file ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator - { - $values = \range( - 200, - 1200, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit06/Configuration/MaximumDuration/phpunit.xml b/test/EndToEnd/PHPUnit06/Configuration/MaximumDuration/phpunit.xml deleted file mode 100644 index 5c65fc972..000000000 --- a/test/EndToEnd/PHPUnit06/Configuration/MaximumDuration/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/Configuration/MaximumDuration/test.phpt b/test/EndToEnd/PHPUnit06/Configuration/MaximumDuration/test.phpt deleted file mode 100644 index cff74af9f..000000000 --- a/test/EndToEnd/PHPUnit06/Configuration/MaximumDuration/test.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -With custom configuration setting the "maximum-duration" parameter in the XML configuration file ---FILE-- -sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanDefaultMaximumDuration + */ + public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds) + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): \Generator + { + $values = \range( + 600, + 1600, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit06/Console/Configuration/Defaults/phpunit.xml b/test/EndToEnd/PHPUnit06/Console/Configuration/Defaults/phpunit.xml new file mode 100644 index 000000000..e31e4bede --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/Configuration/Defaults/phpunit.xml @@ -0,0 +1,26 @@ + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/Configuration/Defaults/test.phpt b/test/EndToEnd/PHPUnit06/Console/Configuration/Defaults/test.phpt new file mode 100644 index 000000000..bf3e16f85 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/Configuration/Defaults/test.phpt @@ -0,0 +1,41 @@ +--TEST-- +With default configuration +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanDefaultMaximumDuration + */ + public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds) + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): \Generator + { + $values = \range( + 600, + 1000, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit06/Console/Configuration/MaximumCount/phpunit.xml b/test/EndToEnd/PHPUnit06/Console/Configuration/MaximumCount/phpunit.xml new file mode 100644 index 000000000..2798ca774 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/Configuration/MaximumCount/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 3 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/Configuration/MaximumCount/test.phpt b/test/EndToEnd/PHPUnit06/Console/Configuration/MaximumCount/test.phpt new file mode 100644 index 000000000..a9d70c5c5 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/Configuration/MaximumCount/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With custom configuration setting the "maximum-count" parameter in the XML configuration file +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator + { + $values = \range( + 200, + 1200, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit06/Console/Configuration/MaximumDuration/phpunit.xml b/test/EndToEnd/PHPUnit06/Console/Configuration/MaximumDuration/phpunit.xml new file mode 100644 index 000000000..0c9f18e20 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/Configuration/MaximumDuration/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/Configuration/MaximumDuration/test.phpt b/test/EndToEnd/PHPUnit06/Console/Configuration/MaximumDuration/test.phpt new file mode 100644 index 000000000..f328e7520 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/Configuration/MaximumDuration/test.phpt @@ -0,0 +1,41 @@ +--TEST-- +With custom configuration setting the "maximum-duration" parameter in the XML configuration file +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/Bare/phpunit.xml b/test/EndToEnd/PHPUnit06/Console/TestCase/Bare/phpunit.xml new file mode 100644 index 000000000..0c9f18e20 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/Bare/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/Bare/test.phpt b/test/EndToEnd/PHPUnit06/Console/TestCase/Bare/test.phpt new file mode 100644 index 000000000..983749f4b --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/Bare/test.phpt @@ -0,0 +1,29 @@ +--TEST-- +With a test case that does not sleep in methods that are not test methods +--FILE-- +sleep(); + } + + public static function tearDownAfterClass() + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function setUp() + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPreConditions() + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPostConditions() + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function tearDown() + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @before + */ + public function sleepWithBeforeAnnotation() + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @beforeClass + */ + public function sleepWithBeforeClassAnnotation() + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @after + */ + public function sleepWithAfterAnnotation() + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @afterClass + */ + public static function sleepWithAfterClassAnnotation() + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/Combination/phpunit.xml b/test/EndToEnd/PHPUnit06/Console/TestCase/Combination/phpunit.xml new file mode 100644 index 000000000..0c9f18e20 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/Combination/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/Combination/test.phpt b/test/EndToEnd/PHPUnit06/Console/TestCase/Combination/test.phpt new file mode 100644 index 000000000..c1b42cd57 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/Combination/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that sleeps in data provider, hook, and test methods +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithAfterAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit06/Console/TestCase/WithAfterAnnotation/phpunit.xml new file mode 100644 index 000000000..0c9f18e20 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithAfterAnnotation/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithAfterAnnotation/test.phpt b/test/EndToEnd/PHPUnit06/Console/TestCase/WithAfterAnnotation/test.phpt new file mode 100644 index 000000000..3d7d3c677 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithAfterAnnotation/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in a method with @after annotation +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithAfterClassAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit06/Console/TestCase/WithAfterClassAnnotation/phpunit.xml new file mode 100644 index 000000000..0c9f18e20 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithAfterClassAnnotation/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithAfterClassAnnotation/test.phpt b/test/EndToEnd/PHPUnit06/Console/TestCase/WithAfterClassAnnotation/test.phpt new file mode 100644 index 000000000..6e2325395 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithAfterClassAnnotation/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that sleeps in a method with @afterClass annotation +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithAssertPostConditions/phpunit.xml b/test/EndToEnd/PHPUnit06/Console/TestCase/WithAssertPostConditions/phpunit.xml new file mode 100644 index 000000000..0c9f18e20 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithAssertPostConditions/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithAssertPostConditions/test.phpt b/test/EndToEnd/PHPUnit06/Console/TestCase/WithAssertPostConditions/test.phpt new file mode 100644 index 000000000..62ffe050c --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithAssertPostConditions/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in assertPostConditions() method +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithAssertPreConditions/phpunit.xml b/test/EndToEnd/PHPUnit06/Console/TestCase/WithAssertPreConditions/phpunit.xml new file mode 100644 index 000000000..0c9f18e20 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithAssertPreConditions/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithAssertPreConditions/test.phpt b/test/EndToEnd/PHPUnit06/Console/TestCase/WithAssertPreConditions/test.phpt new file mode 100644 index 000000000..0c7efb122 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithAssertPreConditions/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in assertPreConditions() method +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithBeforeAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit06/Console/TestCase/WithBeforeAnnotation/phpunit.xml new file mode 100644 index 000000000..0c9f18e20 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithBeforeAnnotation/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithBeforeAnnotation/test.phpt b/test/EndToEnd/PHPUnit06/Console/TestCase/WithBeforeAnnotation/test.phpt new file mode 100644 index 000000000..666b1787c --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithBeforeAnnotation/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in a method with @before annotation +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithBeforeClassAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit06/Console/TestCase/WithBeforeClassAnnotation/phpunit.xml new file mode 100644 index 000000000..0c9f18e20 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithBeforeClassAnnotation/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithBeforeClassAnnotation/test.phpt b/test/EndToEnd/PHPUnit06/Console/TestCase/WithBeforeClassAnnotation/test.phpt new file mode 100644 index 000000000..536cd1933 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithBeforeClassAnnotation/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that sleeps in a method with @beforeClass annotation +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithDataProvider/phpunit.xml b/test/EndToEnd/PHPUnit06/Console/TestCase/WithDataProvider/phpunit.xml new file mode 100644 index 000000000..0c9f18e20 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithDataProvider/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithDataProvider/test.phpt b/test/EndToEnd/PHPUnit06/Console/TestCase/WithDataProvider/test.phpt new file mode 100644 index 000000000..7caa0e621 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithDataProvider/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that sleeps in a data provider +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithSetUp/phpunit.xml b/test/EndToEnd/PHPUnit06/Console/TestCase/WithSetUp/phpunit.xml new file mode 100644 index 000000000..0c9f18e20 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithSetUp/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithSetUp/test.phpt b/test/EndToEnd/PHPUnit06/Console/TestCase/WithSetUp/test.phpt new file mode 100644 index 000000000..86ee6fad3 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithSetUp/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in a setUp() method +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithSetUpBeforeClass/phpunit.xml b/test/EndToEnd/PHPUnit06/Console/TestCase/WithSetUpBeforeClass/phpunit.xml new file mode 100644 index 000000000..0c9f18e20 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithSetUpBeforeClass/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithSetUpBeforeClass/test.phpt b/test/EndToEnd/PHPUnit06/Console/TestCase/WithSetUpBeforeClass/test.phpt new file mode 100644 index 000000000..02ea0620e --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithSetUpBeforeClass/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that sleeps in a setUpBeforeClass() method +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithTearDown/phpunit.xml b/test/EndToEnd/PHPUnit06/Console/TestCase/WithTearDown/phpunit.xml new file mode 100644 index 000000000..0c9f18e20 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithTearDown/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithTearDown/test.phpt b/test/EndToEnd/PHPUnit06/Console/TestCase/WithTearDown/test.phpt new file mode 100644 index 000000000..e4bbac274 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithTearDown/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in a tearDown() method +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithTearDownAfterClass/phpunit.xml b/test/EndToEnd/PHPUnit06/Console/TestCase/WithTearDownAfterClass/phpunit.xml new file mode 100644 index 000000000..0c9f18e20 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithTearDownAfterClass/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithTearDownAfterClass/test.phpt b/test/EndToEnd/PHPUnit06/Console/TestCase/WithTearDownAfterClass/test.phpt new file mode 100644 index 000000000..0ab3561fe --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithTearDownAfterClass/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that sleeps in a tearDownAfterClass() method +--FILE-- + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/TestCase/WithoutTestMethods/test.phpt b/test/EndToEnd/PHPUnit06/Console/TestCase/WithoutTestMethods/test.phpt new file mode 100644 index 000000000..1eca1e3ca --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestCase/WithoutTestMethods/test.phpt @@ -0,0 +1,21 @@ +--TEST-- +With a test case that has no test methods +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @maximumDuration 200 + * + * @slowThreshold 400 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations() + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit06/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit06/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml new file mode 100644 index 000000000..0c9f18e20 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt b/test/EndToEnd/PHPUnit06/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt new file mode 100644 index 000000000..ab1e05422 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With @maximumDuration and @slowThreshold annotations +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @maximumDuration 3.14 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidMaximumDurationAnnotation() + { + $milliseconds = 200; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @maximumDuration 200 + */ + public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation() + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideDataWhereDataNameIsInteger + * + * @maximumDuration 200 + */ + public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNumericDataProvider() + { + $milliseconds = 150; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return list + */ + public static function provideDataWhereDataNameIsInteger(): array + { + return [ + [ + 'bar', + ], + ]; + } + + /** + * @dataProvider provideDataWhereDataNameIsString + * + * @maximumDuration 200 + */ + public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNamedDataProvider() + { + $milliseconds = 150; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return array + */ + public static function provideDataWhereDataNameIsString(): array + { + return [ + 'foo' => [ + 'bar', + ], + ]; + } + + /** + * @maximumDuration 200 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation() + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit06/Console/TestMethod/WithMaximumDurationAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit06/Console/TestMethod/WithMaximumDurationAnnotation/phpunit.xml new file mode 100644 index 000000000..0c9f18e20 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestMethod/WithMaximumDurationAnnotation/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/TestMethod/WithMaximumDurationAnnotation/test.phpt b/test/EndToEnd/PHPUnit06/Console/TestMethod/WithMaximumDurationAnnotation/test.phpt new file mode 100644 index 000000000..56f3cb01b --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestMethod/WithMaximumDurationAnnotation/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With test methods with @maximumDuration annotations +--FILE-- +sleep(); + } + + public static function tearDownAfterClass() + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function setUp() + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPreConditions() + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPostConditions() + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function tearDown() + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @before + */ + public function sleepWithBeforeAnnotation() + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @beforeClass + */ + public static function sleepWithBeforeClassAnnotation() + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @after + */ + public function sleepWithAfterAnnotation() + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @afterClass + */ + public static function sleepWithAfterClassAnnotation() + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration() + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @runInSeparateProcess + */ + public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation() + { + $milliseconds = 50; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration() + { + $milliseconds = 200; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @runInSeparateProcess + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation() + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit06/Console/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit06/Console/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml new file mode 100644 index 000000000..0c9f18e20 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt b/test/EndToEnd/PHPUnit06/Console/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt new file mode 100644 index 000000000..bdef1b521 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt @@ -0,0 +1,38 @@ +--TEST-- +With a test case that sleeps in data provider, hook, and test methods and has test methods with @runInSeparateProcess annotation +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 400 + * + * @maximumDuration 200 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations() + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit06/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit06/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml new file mode 100644 index 000000000..0c9f18e20 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt b/test/EndToEnd/PHPUnit06/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt new file mode 100644 index 000000000..68da64cd0 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With @maximumDuration and @slowThreshold annotations +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 3.14 + * + * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidSlowThresholdAnnotation() + { + $milliseconds = 200; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 200 + * + * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 + */ + public function testSleeperSleepsShorterThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation() + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 200 + * + * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 + */ + public function testSleeperSleepsLongerThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation() + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit06/Console/TestMethod/WithSlowThresholdAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit06/Console/TestMethod/WithSlowThresholdAnnotation/phpunit.xml new file mode 100644 index 000000000..0c9f18e20 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestMethod/WithSlowThresholdAnnotation/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit06/Console/TestMethod/WithSlowThresholdAnnotation/test.phpt b/test/EndToEnd/PHPUnit06/Console/TestMethod/WithSlowThresholdAnnotation/test.phpt new file mode 100644 index 000000000..69544c222 --- /dev/null +++ b/test/EndToEnd/PHPUnit06/Console/TestMethod/WithSlowThresholdAnnotation/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With test methods with @slowThreshold annotations +--FILE-- +sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit06/TestCase/Bare/phpunit.xml b/test/EndToEnd/PHPUnit06/TestCase/Bare/phpunit.xml deleted file mode 100644 index 5c65fc972..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/Bare/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/TestCase/Bare/test.phpt b/test/EndToEnd/PHPUnit06/TestCase/Bare/test.phpt deleted file mode 100644 index 8639d9bcf..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/Bare/test.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -With a test case that does not sleep in methods that are not test methods ---FILE-- -sleep(); - } - - public static function tearDownAfterClass() - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function setUp() - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPreConditions() - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPostConditions() - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function tearDown() - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @before - */ - public function sleepWithBeforeAnnotation() - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @beforeClass - */ - public function sleepWithBeforeClassAnnotation() - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @after - */ - public function sleepWithAfterAnnotation() - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @afterClass - */ - public static function sleepWithAfterClassAnnotation() - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit06/TestCase/Combination/phpunit.xml b/test/EndToEnd/PHPUnit06/TestCase/Combination/phpunit.xml deleted file mode 100644 index 5c65fc972..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/Combination/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/TestCase/Combination/test.phpt b/test/EndToEnd/PHPUnit06/TestCase/Combination/test.phpt deleted file mode 100644 index 19f0e8054..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/Combination/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that sleeps in data provider, hook, and test methods ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithAfterAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit06/TestCase/WithAfterAnnotation/phpunit.xml deleted file mode 100644 index 5c65fc972..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithAfterAnnotation/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithAfterAnnotation/test.phpt b/test/EndToEnd/PHPUnit06/TestCase/WithAfterAnnotation/test.phpt deleted file mode 100644 index c8becb947..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithAfterAnnotation/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with @after annotation ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithAfterClassAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit06/TestCase/WithAfterClassAnnotation/phpunit.xml deleted file mode 100644 index 5c65fc972..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithAfterClassAnnotation/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithAfterClassAnnotation/test.phpt b/test/EndToEnd/PHPUnit06/TestCase/WithAfterClassAnnotation/test.phpt deleted file mode 100644 index 41c99c10f..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithAfterClassAnnotation/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with @afterClass annotation ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithAssertPostConditions/phpunit.xml b/test/EndToEnd/PHPUnit06/TestCase/WithAssertPostConditions/phpunit.xml deleted file mode 100644 index 5c65fc972..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithAssertPostConditions/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithAssertPostConditions/test.phpt b/test/EndToEnd/PHPUnit06/TestCase/WithAssertPostConditions/test.phpt deleted file mode 100644 index a35901c9c..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithAssertPostConditions/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in assertPostConditions() method ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithAssertPreConditions/phpunit.xml b/test/EndToEnd/PHPUnit06/TestCase/WithAssertPreConditions/phpunit.xml deleted file mode 100644 index 5c65fc972..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithAssertPreConditions/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithAssertPreConditions/test.phpt b/test/EndToEnd/PHPUnit06/TestCase/WithAssertPreConditions/test.phpt deleted file mode 100644 index 0b4d23be3..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithAssertPreConditions/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in assertPreConditions() method ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithBeforeAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit06/TestCase/WithBeforeAnnotation/phpunit.xml deleted file mode 100644 index 5c65fc972..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithBeforeAnnotation/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithBeforeAnnotation/test.phpt b/test/EndToEnd/PHPUnit06/TestCase/WithBeforeAnnotation/test.phpt deleted file mode 100644 index 88744d98b..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithBeforeAnnotation/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with @before annotation ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithBeforeClassAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit06/TestCase/WithBeforeClassAnnotation/phpunit.xml deleted file mode 100644 index 5c65fc972..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithBeforeClassAnnotation/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithBeforeClassAnnotation/test.phpt b/test/EndToEnd/PHPUnit06/TestCase/WithBeforeClassAnnotation/test.phpt deleted file mode 100644 index c6f3d3ccd..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithBeforeClassAnnotation/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with @beforeClass annotation ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithDataProvider/phpunit.xml b/test/EndToEnd/PHPUnit06/TestCase/WithDataProvider/phpunit.xml deleted file mode 100644 index 5c65fc972..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithDataProvider/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithDataProvider/test.phpt b/test/EndToEnd/PHPUnit06/TestCase/WithDataProvider/test.phpt deleted file mode 100644 index 6c530070d..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithDataProvider/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that sleeps in a data provider ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithSetUp/phpunit.xml b/test/EndToEnd/PHPUnit06/TestCase/WithSetUp/phpunit.xml deleted file mode 100644 index 5c65fc972..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithSetUp/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithSetUp/test.phpt b/test/EndToEnd/PHPUnit06/TestCase/WithSetUp/test.phpt deleted file mode 100644 index 37a80905c..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithSetUp/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in a setUp() method ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithSetUpBeforeClass/phpunit.xml b/test/EndToEnd/PHPUnit06/TestCase/WithSetUpBeforeClass/phpunit.xml deleted file mode 100644 index 5c65fc972..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithSetUpBeforeClass/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithSetUpBeforeClass/test.phpt b/test/EndToEnd/PHPUnit06/TestCase/WithSetUpBeforeClass/test.phpt deleted file mode 100644 index 673fd8577..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithSetUpBeforeClass/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that sleeps in a setUpBeforeClass() method ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithTearDown/phpunit.xml b/test/EndToEnd/PHPUnit06/TestCase/WithTearDown/phpunit.xml deleted file mode 100644 index 5c65fc972..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithTearDown/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithTearDown/test.phpt b/test/EndToEnd/PHPUnit06/TestCase/WithTearDown/test.phpt deleted file mode 100644 index 09ac256bc..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithTearDown/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in a tearDown() method ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration() - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds) - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): \Generator - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithTearDownAfterClass/phpunit.xml b/test/EndToEnd/PHPUnit06/TestCase/WithTearDownAfterClass/phpunit.xml deleted file mode 100644 index 5c65fc972..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithTearDownAfterClass/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithTearDownAfterClass/test.phpt b/test/EndToEnd/PHPUnit06/TestCase/WithTearDownAfterClass/test.phpt deleted file mode 100644 index d7b94e1a0..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithTearDownAfterClass/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that sleeps in a tearDownAfterClass() method ---FILE-- - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/TestCase/WithoutTestMethods/test.phpt b/test/EndToEnd/PHPUnit06/TestCase/WithoutTestMethods/test.phpt deleted file mode 100644 index 4c1037dd2..000000000 --- a/test/EndToEnd/PHPUnit06/TestCase/WithoutTestMethods/test.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -With a test case that has no test methods ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 200 - * - * @slowThreshold 400 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations() - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit06/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit06/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml deleted file mode 100644 index 5c65fc972..000000000 --- a/test/EndToEnd/PHPUnit06/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt b/test/EndToEnd/PHPUnit06/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt deleted file mode 100644 index cf81166b8..000000000 --- a/test/EndToEnd/PHPUnit06/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With @maximumDuration and @slowThreshold annotations ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 3.14 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidMaximumDurationAnnotation() - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 200 - */ - public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation() - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideDataWhereDataNameIsInteger - * - * @maximumDuration 200 - */ - public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNumericDataProvider() - { - $milliseconds = 150; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return list - */ - public static function provideDataWhereDataNameIsInteger(): array - { - return [ - [ - 'bar', - ], - ]; - } - - /** - * @dataProvider provideDataWhereDataNameIsString - * - * @maximumDuration 200 - */ - public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNamedDataProvider() - { - $milliseconds = 150; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return array - */ - public static function provideDataWhereDataNameIsString(): array - { - return [ - 'foo' => [ - 'bar', - ], - ]; - } - - /** - * @maximumDuration 200 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation() - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit06/TestMethod/WithMaximumDurationAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit06/TestMethod/WithMaximumDurationAnnotation/phpunit.xml deleted file mode 100644 index 5c65fc972..000000000 --- a/test/EndToEnd/PHPUnit06/TestMethod/WithMaximumDurationAnnotation/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/TestMethod/WithMaximumDurationAnnotation/test.phpt b/test/EndToEnd/PHPUnit06/TestMethod/WithMaximumDurationAnnotation/test.phpt deleted file mode 100644 index 27c800e0c..000000000 --- a/test/EndToEnd/PHPUnit06/TestMethod/WithMaximumDurationAnnotation/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With test methods with @maximumDuration annotations ---FILE-- -sleep(); - } - - public static function tearDownAfterClass() - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function setUp() - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPreConditions() - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPostConditions() - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function tearDown() - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @before - */ - public function sleepWithBeforeAnnotation() - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @beforeClass - */ - public static function sleepWithBeforeClassAnnotation() - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @after - */ - public function sleepWithAfterAnnotation() - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @afterClass - */ - public static function sleepWithAfterClassAnnotation() - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration() - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @runInSeparateProcess - */ - public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation() - { - $milliseconds = 50; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration() - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @runInSeparateProcess - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation() - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit06/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit06/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml deleted file mode 100644 index 5c65fc972..000000000 --- a/test/EndToEnd/PHPUnit06/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt b/test/EndToEnd/PHPUnit06/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt deleted file mode 100644 index 4b97dba3a..000000000 --- a/test/EndToEnd/PHPUnit06/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -With a test case that sleeps in data provider, hook, and test methods and has test methods with @runInSeparateProcess annotation ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 400 - * - * @maximumDuration 200 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations() - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit06/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit06/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml deleted file mode 100644 index 5c65fc972..000000000 --- a/test/EndToEnd/PHPUnit06/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt b/test/EndToEnd/PHPUnit06/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt deleted file mode 100644 index b6eb9872d..000000000 --- a/test/EndToEnd/PHPUnit06/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With @maximumDuration and @slowThreshold annotations ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 3.14 - * - * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidSlowThresholdAnnotation() - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 200 - * - * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 - */ - public function testSleeperSleepsShorterThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation() - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 200 - * - * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 - */ - public function testSleeperSleepsLongerThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation() - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit06/TestMethod/WithSlowThresholdAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit06/TestMethod/WithSlowThresholdAnnotation/phpunit.xml deleted file mode 100644 index 5c65fc972..000000000 --- a/test/EndToEnd/PHPUnit06/TestMethod/WithSlowThresholdAnnotation/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit06/TestMethod/WithSlowThresholdAnnotation/test.phpt b/test/EndToEnd/PHPUnit06/TestMethod/WithSlowThresholdAnnotation/test.phpt deleted file mode 100644 index 78edc9e27..000000000 --- a/test/EndToEnd/PHPUnit06/TestMethod/WithSlowThresholdAnnotation/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With test methods with @slowThreshold annotations ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanDefaultMaximumDuration - */ - public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable - { - $values = \range( - 600, - 1600, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit07/Configuration/Defaults/phpunit.xml b/test/EndToEnd/PHPUnit07/Configuration/Defaults/phpunit.xml deleted file mode 100644 index b484eec00..000000000 --- a/test/EndToEnd/PHPUnit07/Configuration/Defaults/phpunit.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/Configuration/Defaults/test.phpt b/test/EndToEnd/PHPUnit07/Configuration/Defaults/test.phpt deleted file mode 100644 index 4d15d9ae6..000000000 --- a/test/EndToEnd/PHPUnit07/Configuration/Defaults/test.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -With default configuration ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanDefaultMaximumDuration - */ - public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable - { - $values = \range( - 600, - 1000, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit07/Configuration/MaximumCount/phpunit.xml b/test/EndToEnd/PHPUnit07/Configuration/MaximumCount/phpunit.xml deleted file mode 100644 index 96c358717..000000000 --- a/test/EndToEnd/PHPUnit07/Configuration/MaximumCount/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 3 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/Configuration/MaximumCount/test.phpt b/test/EndToEnd/PHPUnit07/Configuration/MaximumCount/test.phpt deleted file mode 100644 index 7e5ac7de2..000000000 --- a/test/EndToEnd/PHPUnit07/Configuration/MaximumCount/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With custom configuration setting the "maximum-count" parameter in the XML configuration file ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 1200, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit07/Configuration/MaximumDuration/phpunit.xml b/test/EndToEnd/PHPUnit07/Configuration/MaximumDuration/phpunit.xml deleted file mode 100644 index 69d49f03c..000000000 --- a/test/EndToEnd/PHPUnit07/Configuration/MaximumDuration/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/Configuration/MaximumDuration/test.phpt b/test/EndToEnd/PHPUnit07/Configuration/MaximumDuration/test.phpt deleted file mode 100644 index 41782dc36..000000000 --- a/test/EndToEnd/PHPUnit07/Configuration/MaximumDuration/test.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -With custom configuration setting the "maximum-duration" parameter in the XML configuration file ---FILE-- -sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanDefaultMaximumDuration + */ + public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable + { + $values = \range( + 600, + 1600, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit07/Console/Configuration/Defaults/phpunit.xml b/test/EndToEnd/PHPUnit07/Console/Configuration/Defaults/phpunit.xml new file mode 100644 index 000000000..ff538f7e8 --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/Configuration/Defaults/phpunit.xml @@ -0,0 +1,26 @@ + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/Configuration/Defaults/test.phpt b/test/EndToEnd/PHPUnit07/Console/Configuration/Defaults/test.phpt new file mode 100644 index 000000000..d03634f65 --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/Configuration/Defaults/test.phpt @@ -0,0 +1,41 @@ +--TEST-- +With default configuration +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanDefaultMaximumDuration + */ + public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable + { + $values = \range( + 600, + 1000, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit07/Console/Configuration/MaximumCount/phpunit.xml b/test/EndToEnd/PHPUnit07/Console/Configuration/MaximumCount/phpunit.xml new file mode 100644 index 000000000..8d614dce2 --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/Configuration/MaximumCount/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 3 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/Configuration/MaximumCount/test.phpt b/test/EndToEnd/PHPUnit07/Console/Configuration/MaximumCount/test.phpt new file mode 100644 index 000000000..a23a32554 --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/Configuration/MaximumCount/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With custom configuration setting the "maximum-count" parameter in the XML configuration file +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 1200, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit07/Console/Configuration/MaximumDuration/phpunit.xml b/test/EndToEnd/PHPUnit07/Console/Configuration/MaximumDuration/phpunit.xml new file mode 100644 index 000000000..075863aee --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/Configuration/MaximumDuration/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/Configuration/MaximumDuration/test.phpt b/test/EndToEnd/PHPUnit07/Console/Configuration/MaximumDuration/test.phpt new file mode 100644 index 000000000..f8f65a648 --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/Configuration/MaximumDuration/test.phpt @@ -0,0 +1,41 @@ +--TEST-- +With custom configuration setting the "maximum-duration" parameter in the XML configuration file +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/Bare/phpunit.xml b/test/EndToEnd/PHPUnit07/Console/TestCase/Bare/phpunit.xml new file mode 100644 index 000000000..075863aee --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/Bare/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/Bare/test.phpt b/test/EndToEnd/PHPUnit07/Console/TestCase/Bare/test.phpt new file mode 100644 index 000000000..cf6fb4ba6 --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/Bare/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that does not sleep in methods that are not test methods +--FILE-- +sleep(); + } + + public static function tearDownAfterClass(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function setUp(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPreConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPostConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function tearDown(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @before + */ + public function sleepWithBeforeAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @beforeClass + */ + public function sleepWithBeforeClassAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @after + */ + public function sleepWithAfterAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @afterClass + */ + public static function sleepWithAfterClassAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/Combination/phpunit.xml b/test/EndToEnd/PHPUnit07/Console/TestCase/Combination/phpunit.xml new file mode 100644 index 000000000..075863aee --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/Combination/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/Combination/test.phpt b/test/EndToEnd/PHPUnit07/Console/TestCase/Combination/test.phpt new file mode 100644 index 000000000..fa60fb47c --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/Combination/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in data provider, hook, and test methods +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithAfterAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit07/Console/TestCase/WithAfterAnnotation/phpunit.xml new file mode 100644 index 000000000..075863aee --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithAfterAnnotation/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithAfterAnnotation/test.phpt b/test/EndToEnd/PHPUnit07/Console/TestCase/WithAfterAnnotation/test.phpt new file mode 100644 index 000000000..cee0cb1ef --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithAfterAnnotation/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in a method with @after annotation +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithAfterClassAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit07/Console/TestCase/WithAfterClassAnnotation/phpunit.xml new file mode 100644 index 000000000..075863aee --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithAfterClassAnnotation/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithAfterClassAnnotation/test.phpt b/test/EndToEnd/PHPUnit07/Console/TestCase/WithAfterClassAnnotation/test.phpt new file mode 100644 index 000000000..b9d684a2b --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithAfterClassAnnotation/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that sleeps in a method with @afterClass annotation +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithAssertPostConditions/phpunit.xml b/test/EndToEnd/PHPUnit07/Console/TestCase/WithAssertPostConditions/phpunit.xml new file mode 100644 index 000000000..075863aee --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithAssertPostConditions/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithAssertPostConditions/test.phpt b/test/EndToEnd/PHPUnit07/Console/TestCase/WithAssertPostConditions/test.phpt new file mode 100644 index 000000000..b35a38d73 --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithAssertPostConditions/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in assertPostConditions() method +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithAssertPreConditions/phpunit.xml b/test/EndToEnd/PHPUnit07/Console/TestCase/WithAssertPreConditions/phpunit.xml new file mode 100644 index 000000000..075863aee --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithAssertPreConditions/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithAssertPreConditions/test.phpt b/test/EndToEnd/PHPUnit07/Console/TestCase/WithAssertPreConditions/test.phpt new file mode 100644 index 000000000..9e0f7079b --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithAssertPreConditions/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in assertPreConditions() method +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithBeforeAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit07/Console/TestCase/WithBeforeAnnotation/phpunit.xml new file mode 100644 index 000000000..075863aee --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithBeforeAnnotation/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithBeforeAnnotation/test.phpt b/test/EndToEnd/PHPUnit07/Console/TestCase/WithBeforeAnnotation/test.phpt new file mode 100644 index 000000000..06ac76a12 --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithBeforeAnnotation/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in a method with @before annotation +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithBeforeClassAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit07/Console/TestCase/WithBeforeClassAnnotation/phpunit.xml new file mode 100644 index 000000000..075863aee --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithBeforeClassAnnotation/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithBeforeClassAnnotation/test.phpt b/test/EndToEnd/PHPUnit07/Console/TestCase/WithBeforeClassAnnotation/test.phpt new file mode 100644 index 000000000..f90336421 --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithBeforeClassAnnotation/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that sleeps in a method with @beforeClass annotation +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithDataProvider/phpunit.xml b/test/EndToEnd/PHPUnit07/Console/TestCase/WithDataProvider/phpunit.xml new file mode 100644 index 000000000..075863aee --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithDataProvider/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithDataProvider/test.phpt b/test/EndToEnd/PHPUnit07/Console/TestCase/WithDataProvider/test.phpt new file mode 100644 index 000000000..6214d77c5 --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithDataProvider/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that sleeps in a data provider +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithSetUp/phpunit.xml b/test/EndToEnd/PHPUnit07/Console/TestCase/WithSetUp/phpunit.xml new file mode 100644 index 000000000..075863aee --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithSetUp/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithSetUp/test.phpt b/test/EndToEnd/PHPUnit07/Console/TestCase/WithSetUp/test.phpt new file mode 100644 index 000000000..cd473bea1 --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithSetUp/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in a setUp() method +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithSetUpBeforeClass/phpunit.xml b/test/EndToEnd/PHPUnit07/Console/TestCase/WithSetUpBeforeClass/phpunit.xml new file mode 100644 index 000000000..075863aee --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithSetUpBeforeClass/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithSetUpBeforeClass/test.phpt b/test/EndToEnd/PHPUnit07/Console/TestCase/WithSetUpBeforeClass/test.phpt new file mode 100644 index 000000000..1349b3696 --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithSetUpBeforeClass/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that sleeps in a setUpBeforeClass() method +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithTearDown/phpunit.xml b/test/EndToEnd/PHPUnit07/Console/TestCase/WithTearDown/phpunit.xml new file mode 100644 index 000000000..075863aee --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithTearDown/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithTearDown/test.phpt b/test/EndToEnd/PHPUnit07/Console/TestCase/WithTearDown/test.phpt new file mode 100644 index 000000000..a3999599a --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithTearDown/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in a tearDown() method +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithTearDownAfterClass/phpunit.xml b/test/EndToEnd/PHPUnit07/Console/TestCase/WithTearDownAfterClass/phpunit.xml new file mode 100644 index 000000000..075863aee --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithTearDownAfterClass/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithTearDownAfterClass/test.phpt b/test/EndToEnd/PHPUnit07/Console/TestCase/WithTearDownAfterClass/test.phpt new file mode 100644 index 000000000..9d0104e8d --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithTearDownAfterClass/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that sleeps in a tearDownAfterClass() method +--FILE-- + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/TestCase/WithoutTestMethods/test.phpt b/test/EndToEnd/PHPUnit07/Console/TestCase/WithoutTestMethods/test.phpt new file mode 100644 index 000000000..8df89ca8c --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestCase/WithoutTestMethods/test.phpt @@ -0,0 +1,21 @@ +--TEST-- +With a test case that has no test methods +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @maximumDuration 200 + * + * @slowThreshold 400 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit07/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit07/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml new file mode 100644 index 000000000..075863aee --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt b/test/EndToEnd/PHPUnit07/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt new file mode 100644 index 000000000..79bd7287c --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With @maximumDuration and @slowThreshold annotations +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @maximumDuration 3.14 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidMaximumDurationAnnotation(): void + { + $milliseconds = 200; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @maximumDuration 200 + */ + public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideDataWhereDataNameIsInteger + * + * @maximumDuration 200 + */ + public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNumericDataProvider(): void + { + $milliseconds = 150; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return list + */ + public static function provideDataWhereDataNameIsInteger(): array + { + return [ + [ + 'bar', + ], + ]; + } + + /** + * @dataProvider provideDataWhereDataNameIsString + * + * @maximumDuration 200 + */ + public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNamedDataProvider(): void + { + $milliseconds = 150; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return array + */ + public static function provideDataWhereDataNameIsString(): array + { + return [ + 'foo' => [ + 'bar', + ], + ]; + } + + /** + * @maximumDuration 200 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit07/Console/TestMethod/WithMaximumDurationAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit07/Console/TestMethod/WithMaximumDurationAnnotation/phpunit.xml new file mode 100644 index 000000000..075863aee --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestMethod/WithMaximumDurationAnnotation/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/TestMethod/WithMaximumDurationAnnotation/test.phpt b/test/EndToEnd/PHPUnit07/Console/TestMethod/WithMaximumDurationAnnotation/test.phpt new file mode 100644 index 000000000..48ef7cf49 --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestMethod/WithMaximumDurationAnnotation/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With test methods with @maximumDuration annotations +--FILE-- +sleep(); + } + + public static function tearDownAfterClass(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function setUp(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPreConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPostConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function tearDown(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @before + */ + public function sleepWithBeforeAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @beforeClass + */ + public static function sleepWithBeforeClassAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @after + */ + public function sleepWithAfterAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @afterClass + */ + public static function sleepWithAfterClassAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @runInSeparateProcess + */ + public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation(): void + { + $milliseconds = 50; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 200; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @runInSeparateProcess + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit07/Console/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit07/Console/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml new file mode 100644 index 000000000..075863aee --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt b/test/EndToEnd/PHPUnit07/Console/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt new file mode 100644 index 000000000..5670989ff --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt @@ -0,0 +1,38 @@ +--TEST-- +With a test case that sleeps in data provider, hook, and test methods and has test methods with @runInSeparateProcess annotation +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 400 + * + * @maximumDuration 200 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit07/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit07/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml new file mode 100644 index 000000000..075863aee --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt b/test/EndToEnd/PHPUnit07/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt new file mode 100644 index 000000000..0def4617d --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With @maximumDuration and @slowThreshold annotations +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 3.14 + * + * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidSlowThresholdAnnotation(): void + { + $milliseconds = 200; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 200 + * + * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 + */ + public function testSleeperSleepsShorterThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 200 + * + * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 + */ + public function testSleeperSleepsLongerThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit07/Console/TestMethod/WithSlowThresholdAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit07/Console/TestMethod/WithSlowThresholdAnnotation/phpunit.xml new file mode 100644 index 000000000..075863aee --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestMethod/WithSlowThresholdAnnotation/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit07/Console/TestMethod/WithSlowThresholdAnnotation/test.phpt b/test/EndToEnd/PHPUnit07/Console/TestMethod/WithSlowThresholdAnnotation/test.phpt new file mode 100644 index 000000000..7ce7907b8 --- /dev/null +++ b/test/EndToEnd/PHPUnit07/Console/TestMethod/WithSlowThresholdAnnotation/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With test methods with @slowThreshold annotations +--FILE-- +sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit07/TestCase/Bare/phpunit.xml b/test/EndToEnd/PHPUnit07/TestCase/Bare/phpunit.xml deleted file mode 100644 index 69d49f03c..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/Bare/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/TestCase/Bare/test.phpt b/test/EndToEnd/PHPUnit07/TestCase/Bare/test.phpt deleted file mode 100644 index 14efa22bd..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/Bare/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that does not sleep in methods that are not test methods ---FILE-- -sleep(); - } - - public static function tearDownAfterClass(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function setUp(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPreConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPostConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function tearDown(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @before - */ - public function sleepWithBeforeAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @beforeClass - */ - public function sleepWithBeforeClassAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @after - */ - public function sleepWithAfterAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @afterClass - */ - public static function sleepWithAfterClassAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit07/TestCase/Combination/phpunit.xml b/test/EndToEnd/PHPUnit07/TestCase/Combination/phpunit.xml deleted file mode 100644 index 69d49f03c..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/Combination/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/TestCase/Combination/test.phpt b/test/EndToEnd/PHPUnit07/TestCase/Combination/test.phpt deleted file mode 100644 index ed9d5c8ca..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/Combination/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in data provider, hook, and test methods ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithAfterAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit07/TestCase/WithAfterAnnotation/phpunit.xml deleted file mode 100644 index 69d49f03c..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithAfterAnnotation/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithAfterAnnotation/test.phpt b/test/EndToEnd/PHPUnit07/TestCase/WithAfterAnnotation/test.phpt deleted file mode 100644 index c079ac81a..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithAfterAnnotation/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with @after annotation ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithAfterClassAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit07/TestCase/WithAfterClassAnnotation/phpunit.xml deleted file mode 100644 index 69d49f03c..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithAfterClassAnnotation/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithAfterClassAnnotation/test.phpt b/test/EndToEnd/PHPUnit07/TestCase/WithAfterClassAnnotation/test.phpt deleted file mode 100644 index 04fc3b82b..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithAfterClassAnnotation/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with @afterClass annotation ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithAssertPostConditions/phpunit.xml b/test/EndToEnd/PHPUnit07/TestCase/WithAssertPostConditions/phpunit.xml deleted file mode 100644 index 69d49f03c..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithAssertPostConditions/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithAssertPostConditions/test.phpt b/test/EndToEnd/PHPUnit07/TestCase/WithAssertPostConditions/test.phpt deleted file mode 100644 index f2a97b6a8..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithAssertPostConditions/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in assertPostConditions() method ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithAssertPreConditions/phpunit.xml b/test/EndToEnd/PHPUnit07/TestCase/WithAssertPreConditions/phpunit.xml deleted file mode 100644 index 69d49f03c..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithAssertPreConditions/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithAssertPreConditions/test.phpt b/test/EndToEnd/PHPUnit07/TestCase/WithAssertPreConditions/test.phpt deleted file mode 100644 index ef4ab5577..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithAssertPreConditions/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in assertPreConditions() method ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithBeforeAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit07/TestCase/WithBeforeAnnotation/phpunit.xml deleted file mode 100644 index 69d49f03c..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithBeforeAnnotation/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithBeforeAnnotation/test.phpt b/test/EndToEnd/PHPUnit07/TestCase/WithBeforeAnnotation/test.phpt deleted file mode 100644 index 8ea8cccf9..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithBeforeAnnotation/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with @before annotation ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithBeforeClassAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit07/TestCase/WithBeforeClassAnnotation/phpunit.xml deleted file mode 100644 index 69d49f03c..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithBeforeClassAnnotation/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithBeforeClassAnnotation/test.phpt b/test/EndToEnd/PHPUnit07/TestCase/WithBeforeClassAnnotation/test.phpt deleted file mode 100644 index 34f16f197..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithBeforeClassAnnotation/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with @beforeClass annotation ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithDataProvider/phpunit.xml b/test/EndToEnd/PHPUnit07/TestCase/WithDataProvider/phpunit.xml deleted file mode 100644 index 69d49f03c..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithDataProvider/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithDataProvider/test.phpt b/test/EndToEnd/PHPUnit07/TestCase/WithDataProvider/test.phpt deleted file mode 100644 index 82ba247fb..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithDataProvider/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that sleeps in a data provider ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithSetUp/phpunit.xml b/test/EndToEnd/PHPUnit07/TestCase/WithSetUp/phpunit.xml deleted file mode 100644 index 69d49f03c..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithSetUp/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithSetUp/test.phpt b/test/EndToEnd/PHPUnit07/TestCase/WithSetUp/test.phpt deleted file mode 100644 index 8a33e05f7..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithSetUp/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in a setUp() method ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithSetUpBeforeClass/phpunit.xml b/test/EndToEnd/PHPUnit07/TestCase/WithSetUpBeforeClass/phpunit.xml deleted file mode 100644 index 69d49f03c..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithSetUpBeforeClass/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithSetUpBeforeClass/test.phpt b/test/EndToEnd/PHPUnit07/TestCase/WithSetUpBeforeClass/test.phpt deleted file mode 100644 index 5cc5bede5..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithSetUpBeforeClass/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that sleeps in a setUpBeforeClass() method ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithTearDown/phpunit.xml b/test/EndToEnd/PHPUnit07/TestCase/WithTearDown/phpunit.xml deleted file mode 100644 index 69d49f03c..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithTearDown/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithTearDown/test.phpt b/test/EndToEnd/PHPUnit07/TestCase/WithTearDown/test.phpt deleted file mode 100644 index e2be1a91c..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithTearDown/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in a tearDown() method ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithTearDownAfterClass/phpunit.xml b/test/EndToEnd/PHPUnit07/TestCase/WithTearDownAfterClass/phpunit.xml deleted file mode 100644 index 69d49f03c..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithTearDownAfterClass/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithTearDownAfterClass/test.phpt b/test/EndToEnd/PHPUnit07/TestCase/WithTearDownAfterClass/test.phpt deleted file mode 100644 index 5e36e8060..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithTearDownAfterClass/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that sleeps in a tearDownAfterClass() method ---FILE-- - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/TestCase/WithoutTestMethods/test.phpt b/test/EndToEnd/PHPUnit07/TestCase/WithoutTestMethods/test.phpt deleted file mode 100644 index a4ebf75ac..000000000 --- a/test/EndToEnd/PHPUnit07/TestCase/WithoutTestMethods/test.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -With a test case that has no test methods ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 200 - * - * @slowThreshold 400 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit07/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit07/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml deleted file mode 100644 index 69d49f03c..000000000 --- a/test/EndToEnd/PHPUnit07/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt b/test/EndToEnd/PHPUnit07/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt deleted file mode 100644 index 67b03423e..000000000 --- a/test/EndToEnd/PHPUnit07/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With @maximumDuration and @slowThreshold annotations ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 3.14 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidMaximumDurationAnnotation(): void - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 200 - */ - public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideDataWhereDataNameIsInteger - * - * @maximumDuration 200 - */ - public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNumericDataProvider(): void - { - $milliseconds = 150; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return list - */ - public static function provideDataWhereDataNameIsInteger(): array - { - return [ - [ - 'bar', - ], - ]; - } - - /** - * @dataProvider provideDataWhereDataNameIsString - * - * @maximumDuration 200 - */ - public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNamedDataProvider(): void - { - $milliseconds = 150; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return array - */ - public static function provideDataWhereDataNameIsString(): array - { - return [ - 'foo' => [ - 'bar', - ], - ]; - } - - /** - * @maximumDuration 200 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit07/TestMethod/WithMaximumDurationAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit07/TestMethod/WithMaximumDurationAnnotation/phpunit.xml deleted file mode 100644 index 69d49f03c..000000000 --- a/test/EndToEnd/PHPUnit07/TestMethod/WithMaximumDurationAnnotation/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/TestMethod/WithMaximumDurationAnnotation/test.phpt b/test/EndToEnd/PHPUnit07/TestMethod/WithMaximumDurationAnnotation/test.phpt deleted file mode 100644 index 435eff9ed..000000000 --- a/test/EndToEnd/PHPUnit07/TestMethod/WithMaximumDurationAnnotation/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With test methods with @maximumDuration annotations ---FILE-- -sleep(); - } - - public static function tearDownAfterClass(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function setUp(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPreConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPostConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function tearDown(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @before - */ - public function sleepWithBeforeAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @beforeClass - */ - public static function sleepWithBeforeClassAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @after - */ - public function sleepWithAfterAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @afterClass - */ - public static function sleepWithAfterClassAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @runInSeparateProcess - */ - public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation(): void - { - $milliseconds = 50; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @runInSeparateProcess - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit07/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit07/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml deleted file mode 100644 index 69d49f03c..000000000 --- a/test/EndToEnd/PHPUnit07/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt b/test/EndToEnd/PHPUnit07/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt deleted file mode 100644 index 541f1b2e5..000000000 --- a/test/EndToEnd/PHPUnit07/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -With a test case that sleeps in data provider, hook, and test methods and has test methods with @runInSeparateProcess annotation ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 400 - * - * @maximumDuration 200 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit07/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit07/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml deleted file mode 100644 index 69d49f03c..000000000 --- a/test/EndToEnd/PHPUnit07/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt b/test/EndToEnd/PHPUnit07/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt deleted file mode 100644 index 542365047..000000000 --- a/test/EndToEnd/PHPUnit07/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With @maximumDuration and @slowThreshold annotations ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 3.14 - * - * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidSlowThresholdAnnotation(): void - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 200 - * - * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 - */ - public function testSleeperSleepsShorterThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 200 - * - * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 - */ - public function testSleeperSleepsLongerThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit07/TestMethod/WithSlowThresholdAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit07/TestMethod/WithSlowThresholdAnnotation/phpunit.xml deleted file mode 100644 index 69d49f03c..000000000 --- a/test/EndToEnd/PHPUnit07/TestMethod/WithSlowThresholdAnnotation/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit07/TestMethod/WithSlowThresholdAnnotation/test.phpt b/test/EndToEnd/PHPUnit07/TestMethod/WithSlowThresholdAnnotation/test.phpt deleted file mode 100644 index 3702b3bbd..000000000 --- a/test/EndToEnd/PHPUnit07/TestMethod/WithSlowThresholdAnnotation/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With test methods with @slowThreshold annotations ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanDefaultMaximumDuration - */ - public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable - { - $values = \range( - 600, - 1600, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit08/Configuration/Defaults/phpunit.xml b/test/EndToEnd/PHPUnit08/Configuration/Defaults/phpunit.xml deleted file mode 100644 index d6e1d5b1d..000000000 --- a/test/EndToEnd/PHPUnit08/Configuration/Defaults/phpunit.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/Configuration/Defaults/test.phpt b/test/EndToEnd/PHPUnit08/Configuration/Defaults/test.phpt deleted file mode 100644 index 5654ceb9c..000000000 --- a/test/EndToEnd/PHPUnit08/Configuration/Defaults/test.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -With default configuration ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanDefaultMaximumDuration - */ - public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable - { - $values = \range( - 600, - 1000, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit08/Configuration/MaximumCount/phpunit.xml b/test/EndToEnd/PHPUnit08/Configuration/MaximumCount/phpunit.xml deleted file mode 100644 index ad1971b43..000000000 --- a/test/EndToEnd/PHPUnit08/Configuration/MaximumCount/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 3 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/Configuration/MaximumCount/test.phpt b/test/EndToEnd/PHPUnit08/Configuration/MaximumCount/test.phpt deleted file mode 100644 index a5141db9d..000000000 --- a/test/EndToEnd/PHPUnit08/Configuration/MaximumCount/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With custom configuration setting the "maximum-count" parameter in the XML configuration file ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 1200, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit08/Configuration/MaximumDuration/phpunit.xml b/test/EndToEnd/PHPUnit08/Configuration/MaximumDuration/phpunit.xml deleted file mode 100644 index c7b6adaa3..000000000 --- a/test/EndToEnd/PHPUnit08/Configuration/MaximumDuration/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/Configuration/MaximumDuration/test.phpt b/test/EndToEnd/PHPUnit08/Configuration/MaximumDuration/test.phpt deleted file mode 100644 index 51503c88b..000000000 --- a/test/EndToEnd/PHPUnit08/Configuration/MaximumDuration/test.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -With custom configuration setting the "maximum-duration" parameter in the XML configuration file ---FILE-- -sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanDefaultMaximumDuration + */ + public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable + { + $values = \range( + 600, + 1600, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit08/Console/Configuration/Defaults/phpunit.xml b/test/EndToEnd/PHPUnit08/Console/Configuration/Defaults/phpunit.xml new file mode 100644 index 000000000..e0b3d1bd0 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/Configuration/Defaults/phpunit.xml @@ -0,0 +1,28 @@ + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/Configuration/Defaults/test.phpt b/test/EndToEnd/PHPUnit08/Console/Configuration/Defaults/test.phpt new file mode 100644 index 000000000..72ad0a3eb --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/Configuration/Defaults/test.phpt @@ -0,0 +1,41 @@ +--TEST-- +With default configuration +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanDefaultMaximumDuration + */ + public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable + { + $values = \range( + 600, + 1000, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit08/Console/Configuration/MaximumCount/phpunit.xml b/test/EndToEnd/PHPUnit08/Console/Configuration/MaximumCount/phpunit.xml new file mode 100644 index 000000000..3004c61d6 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/Configuration/MaximumCount/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 3 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/Configuration/MaximumCount/test.phpt b/test/EndToEnd/PHPUnit08/Console/Configuration/MaximumCount/test.phpt new file mode 100644 index 000000000..1953d53d2 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/Configuration/MaximumCount/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With custom configuration setting the "maximum-count" parameter in the XML configuration file +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 1200, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit08/Console/Configuration/MaximumDuration/phpunit.xml b/test/EndToEnd/PHPUnit08/Console/Configuration/MaximumDuration/phpunit.xml new file mode 100644 index 000000000..1d4c5f9e1 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/Configuration/MaximumDuration/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/Configuration/MaximumDuration/test.phpt b/test/EndToEnd/PHPUnit08/Console/Configuration/MaximumDuration/test.phpt new file mode 100644 index 000000000..259555696 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/Configuration/MaximumDuration/test.phpt @@ -0,0 +1,41 @@ +--TEST-- +With custom configuration setting the "maximum-duration" parameter in the XML configuration file +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/Bare/phpunit.xml b/test/EndToEnd/PHPUnit08/Console/TestCase/Bare/phpunit.xml new file mode 100644 index 000000000..1d4c5f9e1 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/Bare/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/Bare/test.phpt b/test/EndToEnd/PHPUnit08/Console/TestCase/Bare/test.phpt new file mode 100644 index 000000000..9c49c3ff4 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/Bare/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that does not sleep in methods that are not test methods +--FILE-- +sleep(); + } + + public static function tearDownAfterClass(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function setUp(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPreConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPostConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function tearDown(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @before + */ + public function sleepWithBeforeAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @beforeClass + */ + public function sleepWithBeforeClassAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @after + */ + public function sleepWithAfterAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @afterClass + */ + public static function sleepWithAfterClassAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/Combination/phpunit.xml b/test/EndToEnd/PHPUnit08/Console/TestCase/Combination/phpunit.xml new file mode 100644 index 000000000..1d4c5f9e1 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/Combination/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/Combination/test.phpt b/test/EndToEnd/PHPUnit08/Console/TestCase/Combination/test.phpt new file mode 100644 index 000000000..2eff7c277 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/Combination/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in data provider, hook, and test methods +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithAfterAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit08/Console/TestCase/WithAfterAnnotation/phpunit.xml new file mode 100644 index 000000000..1d4c5f9e1 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithAfterAnnotation/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithAfterAnnotation/test.phpt b/test/EndToEnd/PHPUnit08/Console/TestCase/WithAfterAnnotation/test.phpt new file mode 100644 index 000000000..cf3116b01 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithAfterAnnotation/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in a method with @after annotation +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithAfterClassAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit08/Console/TestCase/WithAfterClassAnnotation/phpunit.xml new file mode 100644 index 000000000..1d4c5f9e1 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithAfterClassAnnotation/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithAfterClassAnnotation/test.phpt b/test/EndToEnd/PHPUnit08/Console/TestCase/WithAfterClassAnnotation/test.phpt new file mode 100644 index 000000000..0c3b91cc8 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithAfterClassAnnotation/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that sleeps in a method with @afterClass annotation +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithAssertPostConditions/phpunit.xml b/test/EndToEnd/PHPUnit08/Console/TestCase/WithAssertPostConditions/phpunit.xml new file mode 100644 index 000000000..1d4c5f9e1 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithAssertPostConditions/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithAssertPostConditions/test.phpt b/test/EndToEnd/PHPUnit08/Console/TestCase/WithAssertPostConditions/test.phpt new file mode 100644 index 000000000..22576ccba --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithAssertPostConditions/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in assertPostConditions() method +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithAssertPreConditions/phpunit.xml b/test/EndToEnd/PHPUnit08/Console/TestCase/WithAssertPreConditions/phpunit.xml new file mode 100644 index 000000000..1d4c5f9e1 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithAssertPreConditions/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithAssertPreConditions/test.phpt b/test/EndToEnd/PHPUnit08/Console/TestCase/WithAssertPreConditions/test.phpt new file mode 100644 index 000000000..ddb45de96 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithAssertPreConditions/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in assertPreConditions() method +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithBeforeAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit08/Console/TestCase/WithBeforeAnnotation/phpunit.xml new file mode 100644 index 000000000..1d4c5f9e1 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithBeforeAnnotation/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithBeforeAnnotation/test.phpt b/test/EndToEnd/PHPUnit08/Console/TestCase/WithBeforeAnnotation/test.phpt new file mode 100644 index 000000000..e47e5740c --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithBeforeAnnotation/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in a method with @before annotation +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithBeforeClassAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit08/Console/TestCase/WithBeforeClassAnnotation/phpunit.xml new file mode 100644 index 000000000..1d4c5f9e1 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithBeforeClassAnnotation/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithBeforeClassAnnotation/test.phpt b/test/EndToEnd/PHPUnit08/Console/TestCase/WithBeforeClassAnnotation/test.phpt new file mode 100644 index 000000000..2601ee9b5 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithBeforeClassAnnotation/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that sleeps in a method with @beforeClass annotation +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithDataProvider/phpunit.xml b/test/EndToEnd/PHPUnit08/Console/TestCase/WithDataProvider/phpunit.xml new file mode 100644 index 000000000..1d4c5f9e1 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithDataProvider/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithDataProvider/test.phpt b/test/EndToEnd/PHPUnit08/Console/TestCase/WithDataProvider/test.phpt new file mode 100644 index 000000000..367ea0aeb --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithDataProvider/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that sleeps in a data provider +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithSetUp/phpunit.xml b/test/EndToEnd/PHPUnit08/Console/TestCase/WithSetUp/phpunit.xml new file mode 100644 index 000000000..1d4c5f9e1 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithSetUp/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithSetUp/test.phpt b/test/EndToEnd/PHPUnit08/Console/TestCase/WithSetUp/test.phpt new file mode 100644 index 000000000..dfb72a81a --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithSetUp/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in a setUp() method +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithSetUpBeforeClass/phpunit.xml b/test/EndToEnd/PHPUnit08/Console/TestCase/WithSetUpBeforeClass/phpunit.xml new file mode 100644 index 000000000..1d4c5f9e1 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithSetUpBeforeClass/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithSetUpBeforeClass/test.phpt b/test/EndToEnd/PHPUnit08/Console/TestCase/WithSetUpBeforeClass/test.phpt new file mode 100644 index 000000000..db08083be --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithSetUpBeforeClass/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that sleeps in a setUpBeforeClass() method +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithTearDown/phpunit.xml b/test/EndToEnd/PHPUnit08/Console/TestCase/WithTearDown/phpunit.xml new file mode 100644 index 000000000..1d4c5f9e1 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithTearDown/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithTearDown/test.phpt b/test/EndToEnd/PHPUnit08/Console/TestCase/WithTearDown/test.phpt new file mode 100644 index 000000000..9cd7a3f53 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithTearDown/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in a tearDown() method +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithTearDownAfterClass/phpunit.xml b/test/EndToEnd/PHPUnit08/Console/TestCase/WithTearDownAfterClass/phpunit.xml new file mode 100644 index 000000000..1d4c5f9e1 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithTearDownAfterClass/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithTearDownAfterClass/test.phpt b/test/EndToEnd/PHPUnit08/Console/TestCase/WithTearDownAfterClass/test.phpt new file mode 100644 index 000000000..138a18717 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithTearDownAfterClass/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that sleeps in a tearDownAfterClass() method +--FILE-- + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/TestCase/WithoutTestMethods/test.phpt b/test/EndToEnd/PHPUnit08/Console/TestCase/WithoutTestMethods/test.phpt new file mode 100644 index 000000000..9cab35e18 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestCase/WithoutTestMethods/test.phpt @@ -0,0 +1,21 @@ +--TEST-- +With a test case that has no test methods +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @maximumDuration 200 + * + * @slowThreshold 400 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit08/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit08/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml new file mode 100644 index 000000000..1d4c5f9e1 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt b/test/EndToEnd/PHPUnit08/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt new file mode 100644 index 000000000..4d9d6b35b --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With @maximumDuration and @slowThreshold annotations +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @maximumDuration 3.14 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidMaximumDurationAnnotation(): void + { + $milliseconds = 200; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @maximumDuration 200 + */ + public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideDataWhereDataNameIsInteger + * + * @maximumDuration 200 + */ + public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNumericDataProvider(): void + { + $milliseconds = 150; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return list + */ + public static function provideDataWhereDataNameIsInteger(): array + { + return [ + [ + 'bar', + ], + ]; + } + + /** + * @dataProvider provideDataWhereDataNameIsString + * + * @maximumDuration 200 + */ + public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNamedDataProvider(): void + { + $milliseconds = 150; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return array + */ + public static function provideDataWhereDataNameIsString(): array + { + return [ + 'foo' => [ + 'bar', + ], + ]; + } + + /** + * @maximumDuration 200 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit08/Console/TestMethod/WithMaximumDurationAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit08/Console/TestMethod/WithMaximumDurationAnnotation/phpunit.xml new file mode 100644 index 000000000..1d4c5f9e1 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestMethod/WithMaximumDurationAnnotation/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/TestMethod/WithMaximumDurationAnnotation/test.phpt b/test/EndToEnd/PHPUnit08/Console/TestMethod/WithMaximumDurationAnnotation/test.phpt new file mode 100644 index 000000000..a27460d98 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestMethod/WithMaximumDurationAnnotation/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With test methods with @maximumDuration annotations +--FILE-- +sleep(); + } + + public static function tearDownAfterClass(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function setUp(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPreConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPostConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function tearDown(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @before + */ + public function sleepWithBeforeAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @beforeClass + */ + public static function sleepWithBeforeClassAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @after + */ + public function sleepWithAfterAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @afterClass + */ + public static function sleepWithAfterClassAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @runInSeparateProcess + */ + public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation(): void + { + $milliseconds = 50; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 200; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @runInSeparateProcess + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit08/Console/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit08/Console/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml new file mode 100644 index 000000000..1d4c5f9e1 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt b/test/EndToEnd/PHPUnit08/Console/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt new file mode 100644 index 000000000..a2712ef91 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt @@ -0,0 +1,38 @@ +--TEST-- +With a test case that sleeps in data provider, hook, and test methods and has test methods with @runInSeparateProcess annotation +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 400 + * + * @maximumDuration 200 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit08/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit08/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml new file mode 100644 index 000000000..1d4c5f9e1 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt b/test/EndToEnd/PHPUnit08/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt new file mode 100644 index 000000000..ee00f48db --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With @maximumDuration and @slowThreshold annotations +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 3.14 + * + * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidSlowThresholdAnnotation(): void + { + $milliseconds = 200; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 200 + * + * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 + */ + public function testSleeperSleepsShorterThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 200 + * + * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 + */ + public function testSleeperSleepsLongerThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit08/Console/TestMethod/WithSlowThresholdAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit08/Console/TestMethod/WithSlowThresholdAnnotation/phpunit.xml new file mode 100644 index 000000000..1d4c5f9e1 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestMethod/WithSlowThresholdAnnotation/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit08/Console/TestMethod/WithSlowThresholdAnnotation/test.phpt b/test/EndToEnd/PHPUnit08/Console/TestMethod/WithSlowThresholdAnnotation/test.phpt new file mode 100644 index 000000000..5463918e1 --- /dev/null +++ b/test/EndToEnd/PHPUnit08/Console/TestMethod/WithSlowThresholdAnnotation/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With test methods with @slowThreshold annotations +--FILE-- +sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit08/TestCase/Bare/phpunit.xml b/test/EndToEnd/PHPUnit08/TestCase/Bare/phpunit.xml deleted file mode 100644 index c7b6adaa3..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/Bare/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/TestCase/Bare/test.phpt b/test/EndToEnd/PHPUnit08/TestCase/Bare/test.phpt deleted file mode 100644 index 3c842b243..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/Bare/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that does not sleep in methods that are not test methods ---FILE-- -sleep(); - } - - public static function tearDownAfterClass(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function setUp(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPreConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPostConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function tearDown(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @before - */ - public function sleepWithBeforeAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @beforeClass - */ - public function sleepWithBeforeClassAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @after - */ - public function sleepWithAfterAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @afterClass - */ - public static function sleepWithAfterClassAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit08/TestCase/Combination/phpunit.xml b/test/EndToEnd/PHPUnit08/TestCase/Combination/phpunit.xml deleted file mode 100644 index c7b6adaa3..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/Combination/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/TestCase/Combination/test.phpt b/test/EndToEnd/PHPUnit08/TestCase/Combination/test.phpt deleted file mode 100644 index e088cc1ef..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/Combination/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in data provider, hook, and test methods ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithAfterAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit08/TestCase/WithAfterAnnotation/phpunit.xml deleted file mode 100644 index c7b6adaa3..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithAfterAnnotation/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithAfterAnnotation/test.phpt b/test/EndToEnd/PHPUnit08/TestCase/WithAfterAnnotation/test.phpt deleted file mode 100644 index 4bb8fceaf..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithAfterAnnotation/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with @after annotation ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithAfterClassAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit08/TestCase/WithAfterClassAnnotation/phpunit.xml deleted file mode 100644 index c7b6adaa3..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithAfterClassAnnotation/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithAfterClassAnnotation/test.phpt b/test/EndToEnd/PHPUnit08/TestCase/WithAfterClassAnnotation/test.phpt deleted file mode 100644 index 026538714..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithAfterClassAnnotation/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with @afterClass annotation ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithAssertPostConditions/phpunit.xml b/test/EndToEnd/PHPUnit08/TestCase/WithAssertPostConditions/phpunit.xml deleted file mode 100644 index c7b6adaa3..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithAssertPostConditions/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithAssertPostConditions/test.phpt b/test/EndToEnd/PHPUnit08/TestCase/WithAssertPostConditions/test.phpt deleted file mode 100644 index 007d22e5c..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithAssertPostConditions/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in assertPostConditions() method ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithAssertPreConditions/phpunit.xml b/test/EndToEnd/PHPUnit08/TestCase/WithAssertPreConditions/phpunit.xml deleted file mode 100644 index c7b6adaa3..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithAssertPreConditions/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithAssertPreConditions/test.phpt b/test/EndToEnd/PHPUnit08/TestCase/WithAssertPreConditions/test.phpt deleted file mode 100644 index c9c2d26f8..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithAssertPreConditions/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in assertPreConditions() method ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithBeforeAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit08/TestCase/WithBeforeAnnotation/phpunit.xml deleted file mode 100644 index c7b6adaa3..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithBeforeAnnotation/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithBeforeAnnotation/test.phpt b/test/EndToEnd/PHPUnit08/TestCase/WithBeforeAnnotation/test.phpt deleted file mode 100644 index 90db98976..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithBeforeAnnotation/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with @before annotation ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithBeforeClassAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit08/TestCase/WithBeforeClassAnnotation/phpunit.xml deleted file mode 100644 index c7b6adaa3..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithBeforeClassAnnotation/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithBeforeClassAnnotation/test.phpt b/test/EndToEnd/PHPUnit08/TestCase/WithBeforeClassAnnotation/test.phpt deleted file mode 100644 index ebf7b45da..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithBeforeClassAnnotation/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with @beforeClass annotation ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithDataProvider/phpunit.xml b/test/EndToEnd/PHPUnit08/TestCase/WithDataProvider/phpunit.xml deleted file mode 100644 index c7b6adaa3..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithDataProvider/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithDataProvider/test.phpt b/test/EndToEnd/PHPUnit08/TestCase/WithDataProvider/test.phpt deleted file mode 100644 index 2f661eddc..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithDataProvider/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that sleeps in a data provider ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithSetUp/phpunit.xml b/test/EndToEnd/PHPUnit08/TestCase/WithSetUp/phpunit.xml deleted file mode 100644 index c7b6adaa3..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithSetUp/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithSetUp/test.phpt b/test/EndToEnd/PHPUnit08/TestCase/WithSetUp/test.phpt deleted file mode 100644 index 72eb2c263..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithSetUp/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in a setUp() method ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithSetUpBeforeClass/phpunit.xml b/test/EndToEnd/PHPUnit08/TestCase/WithSetUpBeforeClass/phpunit.xml deleted file mode 100644 index c7b6adaa3..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithSetUpBeforeClass/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithSetUpBeforeClass/test.phpt b/test/EndToEnd/PHPUnit08/TestCase/WithSetUpBeforeClass/test.phpt deleted file mode 100644 index 472b26e84..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithSetUpBeforeClass/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that sleeps in a setUpBeforeClass() method ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithTearDown/phpunit.xml b/test/EndToEnd/PHPUnit08/TestCase/WithTearDown/phpunit.xml deleted file mode 100644 index c7b6adaa3..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithTearDown/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithTearDown/test.phpt b/test/EndToEnd/PHPUnit08/TestCase/WithTearDown/test.phpt deleted file mode 100644 index a6731599b..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithTearDown/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in a tearDown() method ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithTearDownAfterClass/phpunit.xml b/test/EndToEnd/PHPUnit08/TestCase/WithTearDownAfterClass/phpunit.xml deleted file mode 100644 index c7b6adaa3..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithTearDownAfterClass/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithTearDownAfterClass/test.phpt b/test/EndToEnd/PHPUnit08/TestCase/WithTearDownAfterClass/test.phpt deleted file mode 100644 index bc9e1b87f..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithTearDownAfterClass/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that sleeps in a tearDownAfterClass() method ---FILE-- - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/TestCase/WithoutTestMethods/test.phpt b/test/EndToEnd/PHPUnit08/TestCase/WithoutTestMethods/test.phpt deleted file mode 100644 index 18315aa91..000000000 --- a/test/EndToEnd/PHPUnit08/TestCase/WithoutTestMethods/test.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -With a test case that has no test methods ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 200 - * - * @slowThreshold 400 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit08/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit08/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml deleted file mode 100644 index c7b6adaa3..000000000 --- a/test/EndToEnd/PHPUnit08/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt b/test/EndToEnd/PHPUnit08/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt deleted file mode 100644 index e8e801d58..000000000 --- a/test/EndToEnd/PHPUnit08/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With @maximumDuration and @slowThreshold annotations ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 3.14 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidMaximumDurationAnnotation(): void - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 200 - */ - public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideDataWhereDataNameIsInteger - * - * @maximumDuration 200 - */ - public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNumericDataProvider(): void - { - $milliseconds = 150; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return list - */ - public static function provideDataWhereDataNameIsInteger(): array - { - return [ - [ - 'bar', - ], - ]; - } - - /** - * @dataProvider provideDataWhereDataNameIsString - * - * @maximumDuration 200 - */ - public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNamedDataProvider(): void - { - $milliseconds = 150; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return array - */ - public static function provideDataWhereDataNameIsString(): array - { - return [ - 'foo' => [ - 'bar', - ], - ]; - } - - /** - * @maximumDuration 200 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit08/TestMethod/WithMaximumDurationAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit08/TestMethod/WithMaximumDurationAnnotation/phpunit.xml deleted file mode 100644 index c7b6adaa3..000000000 --- a/test/EndToEnd/PHPUnit08/TestMethod/WithMaximumDurationAnnotation/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/TestMethod/WithMaximumDurationAnnotation/test.phpt b/test/EndToEnd/PHPUnit08/TestMethod/WithMaximumDurationAnnotation/test.phpt deleted file mode 100644 index c2b2f8131..000000000 --- a/test/EndToEnd/PHPUnit08/TestMethod/WithMaximumDurationAnnotation/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With test methods with @maximumDuration annotations ---FILE-- -sleep(); - } - - public static function tearDownAfterClass(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function setUp(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPreConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPostConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function tearDown(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @before - */ - public function sleepWithBeforeAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @beforeClass - */ - public static function sleepWithBeforeClassAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @after - */ - public function sleepWithAfterAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @afterClass - */ - public static function sleepWithAfterClassAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @runInSeparateProcess - */ - public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation(): void - { - $milliseconds = 50; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @runInSeparateProcess - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit08/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit08/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml deleted file mode 100644 index c7b6adaa3..000000000 --- a/test/EndToEnd/PHPUnit08/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt b/test/EndToEnd/PHPUnit08/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt deleted file mode 100644 index 05169a1f2..000000000 --- a/test/EndToEnd/PHPUnit08/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -With a test case that sleeps in data provider, hook, and test methods and has test methods with @runInSeparateProcess annotation ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 400 - * - * @maximumDuration 200 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit08/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit08/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml deleted file mode 100644 index c7b6adaa3..000000000 --- a/test/EndToEnd/PHPUnit08/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt b/test/EndToEnd/PHPUnit08/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt deleted file mode 100644 index b725d72f5..000000000 --- a/test/EndToEnd/PHPUnit08/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With @maximumDuration and @slowThreshold annotations ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 3.14 - * - * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidSlowThresholdAnnotation(): void - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 200 - * - * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 - */ - public function testSleeperSleepsShorterThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 200 - * - * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 - */ - public function testSleeperSleepsLongerThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit08/TestMethod/WithSlowThresholdAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit08/TestMethod/WithSlowThresholdAnnotation/phpunit.xml deleted file mode 100644 index c7b6adaa3..000000000 --- a/test/EndToEnd/PHPUnit08/TestMethod/WithSlowThresholdAnnotation/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit08/TestMethod/WithSlowThresholdAnnotation/test.phpt b/test/EndToEnd/PHPUnit08/TestMethod/WithSlowThresholdAnnotation/test.phpt deleted file mode 100644 index dc4e241fd..000000000 --- a/test/EndToEnd/PHPUnit08/TestMethod/WithSlowThresholdAnnotation/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With test methods with @slowThreshold annotations ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanDefaultMaximumDuration - */ - public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable - { - $values = \range( - 600, - 1600, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit09/Configuration/Defaults/phpunit.xml b/test/EndToEnd/PHPUnit09/Configuration/Defaults/phpunit.xml deleted file mode 100644 index 03aeaec38..000000000 --- a/test/EndToEnd/PHPUnit09/Configuration/Defaults/phpunit.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/Configuration/Defaults/test.phpt b/test/EndToEnd/PHPUnit09/Configuration/Defaults/test.phpt deleted file mode 100644 index 3acbd2da3..000000000 --- a/test/EndToEnd/PHPUnit09/Configuration/Defaults/test.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -With default configuration ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanDefaultMaximumDuration - */ - public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable - { - $values = \range( - 600, - 1000, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit09/Configuration/MaximumCount/phpunit.xml b/test/EndToEnd/PHPUnit09/Configuration/MaximumCount/phpunit.xml deleted file mode 100644 index 10edfcfba..000000000 --- a/test/EndToEnd/PHPUnit09/Configuration/MaximumCount/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 3 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/Configuration/MaximumCount/test.phpt b/test/EndToEnd/PHPUnit09/Configuration/MaximumCount/test.phpt deleted file mode 100644 index 3b0baf831..000000000 --- a/test/EndToEnd/PHPUnit09/Configuration/MaximumCount/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With custom configuration setting the "maximum-count" parameter in the XML configuration file ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 1200, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit09/Configuration/MaximumDuration/phpunit.xml b/test/EndToEnd/PHPUnit09/Configuration/MaximumDuration/phpunit.xml deleted file mode 100644 index 7f7ff83b0..000000000 --- a/test/EndToEnd/PHPUnit09/Configuration/MaximumDuration/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/Configuration/MaximumDuration/test.phpt b/test/EndToEnd/PHPUnit09/Configuration/MaximumDuration/test.phpt deleted file mode 100644 index e963396cd..000000000 --- a/test/EndToEnd/PHPUnit09/Configuration/MaximumDuration/test.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -With custom configuration setting the "maximum-duration" parameter in the XML configuration file ---FILE-- -sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanDefaultMaximumDuration + */ + public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable + { + $values = \range( + 600, + 1600, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit09/Console/Configuration/Defaults/phpunit.xml b/test/EndToEnd/PHPUnit09/Console/Configuration/Defaults/phpunit.xml new file mode 100644 index 000000000..d6b1c94c3 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/Configuration/Defaults/phpunit.xml @@ -0,0 +1,28 @@ + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/Configuration/Defaults/test.phpt b/test/EndToEnd/PHPUnit09/Console/Configuration/Defaults/test.phpt new file mode 100644 index 000000000..eea073710 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/Configuration/Defaults/test.phpt @@ -0,0 +1,41 @@ +--TEST-- +With default configuration +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanDefaultMaximumDuration + */ + public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable + { + $values = \range( + 600, + 1000, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit09/Console/Configuration/MaximumCount/phpunit.xml b/test/EndToEnd/PHPUnit09/Console/Configuration/MaximumCount/phpunit.xml new file mode 100644 index 000000000..479a8d748 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/Configuration/MaximumCount/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 3 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/Configuration/MaximumCount/test.phpt b/test/EndToEnd/PHPUnit09/Console/Configuration/MaximumCount/test.phpt new file mode 100644 index 000000000..1fe6831dc --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/Configuration/MaximumCount/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With custom configuration setting the "maximum-count" parameter in the XML configuration file +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 1200, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit09/Console/Configuration/MaximumDuration/phpunit.xml b/test/EndToEnd/PHPUnit09/Console/Configuration/MaximumDuration/phpunit.xml new file mode 100644 index 000000000..1db3d3941 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/Configuration/MaximumDuration/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/Configuration/MaximumDuration/test.phpt b/test/EndToEnd/PHPUnit09/Console/Configuration/MaximumDuration/test.phpt new file mode 100644 index 000000000..5b5fab8a5 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/Configuration/MaximumDuration/test.phpt @@ -0,0 +1,41 @@ +--TEST-- +With custom configuration setting the "maximum-duration" parameter in the XML configuration file +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/Bare/phpunit.xml b/test/EndToEnd/PHPUnit09/Console/TestCase/Bare/phpunit.xml new file mode 100644 index 000000000..1db3d3941 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/Bare/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/Bare/test.phpt b/test/EndToEnd/PHPUnit09/Console/TestCase/Bare/test.phpt new file mode 100644 index 000000000..d0944d515 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/Bare/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that does not sleep in methods that are not test methods +--FILE-- +sleep(); + } + + public static function tearDownAfterClass(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function setUp(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPreConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPostConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function tearDown(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @before + */ + public function sleepWithBeforeAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @beforeClass + */ + public static function sleepWithBeforeClassAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @after + */ + public function sleepWithAfterAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @afterClass + */ + public static function sleepWithAfterClassAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/Combination/phpunit.xml b/test/EndToEnd/PHPUnit09/Console/TestCase/Combination/phpunit.xml new file mode 100644 index 000000000..1db3d3941 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/Combination/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/Combination/test.phpt b/test/EndToEnd/PHPUnit09/Console/TestCase/Combination/test.phpt new file mode 100644 index 000000000..f35471e41 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/Combination/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in data provider, hook, and test methods +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithAfterAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit09/Console/TestCase/WithAfterAnnotation/phpunit.xml new file mode 100644 index 000000000..1db3d3941 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithAfterAnnotation/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithAfterAnnotation/test.phpt b/test/EndToEnd/PHPUnit09/Console/TestCase/WithAfterAnnotation/test.phpt new file mode 100644 index 000000000..2a457b416 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithAfterAnnotation/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in a method with @after annotation +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithAfterClassAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit09/Console/TestCase/WithAfterClassAnnotation/phpunit.xml new file mode 100644 index 000000000..1db3d3941 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithAfterClassAnnotation/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithAfterClassAnnotation/test.phpt b/test/EndToEnd/PHPUnit09/Console/TestCase/WithAfterClassAnnotation/test.phpt new file mode 100644 index 000000000..b3bbdefa7 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithAfterClassAnnotation/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that sleeps in a method with @afterClass annotation +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithAssertPostConditions/phpunit.xml b/test/EndToEnd/PHPUnit09/Console/TestCase/WithAssertPostConditions/phpunit.xml new file mode 100644 index 000000000..1db3d3941 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithAssertPostConditions/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithAssertPostConditions/test.phpt b/test/EndToEnd/PHPUnit09/Console/TestCase/WithAssertPostConditions/test.phpt new file mode 100644 index 000000000..721bcb04d --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithAssertPostConditions/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in assertPostConditions() method +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithAssertPreConditions/phpunit.xml b/test/EndToEnd/PHPUnit09/Console/TestCase/WithAssertPreConditions/phpunit.xml new file mode 100644 index 000000000..1db3d3941 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithAssertPreConditions/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithAssertPreConditions/test.phpt b/test/EndToEnd/PHPUnit09/Console/TestCase/WithAssertPreConditions/test.phpt new file mode 100644 index 000000000..98f53a482 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithAssertPreConditions/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in assertPreConditions() method +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithBeforeAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit09/Console/TestCase/WithBeforeAnnotation/phpunit.xml new file mode 100644 index 000000000..1db3d3941 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithBeforeAnnotation/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithBeforeAnnotation/test.phpt b/test/EndToEnd/PHPUnit09/Console/TestCase/WithBeforeAnnotation/test.phpt new file mode 100644 index 000000000..0b176f741 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithBeforeAnnotation/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in a method with @before annotation +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithBeforeClassAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit09/Console/TestCase/WithBeforeClassAnnotation/phpunit.xml new file mode 100644 index 000000000..1db3d3941 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithBeforeClassAnnotation/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithBeforeClassAnnotation/test.phpt b/test/EndToEnd/PHPUnit09/Console/TestCase/WithBeforeClassAnnotation/test.phpt new file mode 100644 index 000000000..9bff8728a --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithBeforeClassAnnotation/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that sleeps in a method with @beforeClass annotation +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithDataProvider/phpunit.xml b/test/EndToEnd/PHPUnit09/Console/TestCase/WithDataProvider/phpunit.xml new file mode 100644 index 000000000..1db3d3941 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithDataProvider/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithDataProvider/test.phpt b/test/EndToEnd/PHPUnit09/Console/TestCase/WithDataProvider/test.phpt new file mode 100644 index 000000000..e4ef201ab --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithDataProvider/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that sleeps in a data provider +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithSetUp/phpunit.xml b/test/EndToEnd/PHPUnit09/Console/TestCase/WithSetUp/phpunit.xml new file mode 100644 index 000000000..1db3d3941 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithSetUp/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithSetUp/test.phpt b/test/EndToEnd/PHPUnit09/Console/TestCase/WithSetUp/test.phpt new file mode 100644 index 000000000..59b1cbc1a --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithSetUp/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in a setUp() method +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithSetUpBeforeClass/phpunit.xml b/test/EndToEnd/PHPUnit09/Console/TestCase/WithSetUpBeforeClass/phpunit.xml new file mode 100644 index 000000000..1db3d3941 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithSetUpBeforeClass/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithSetUpBeforeClass/test.phpt b/test/EndToEnd/PHPUnit09/Console/TestCase/WithSetUpBeforeClass/test.phpt new file mode 100644 index 000000000..0e021293b --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithSetUpBeforeClass/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that sleeps in a setUpBeforeClass() method +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithTearDown/phpunit.xml b/test/EndToEnd/PHPUnit09/Console/TestCase/WithTearDown/phpunit.xml new file mode 100644 index 000000000..1db3d3941 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithTearDown/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithTearDown/test.phpt b/test/EndToEnd/PHPUnit09/Console/TestCase/WithTearDown/test.phpt new file mode 100644 index 000000000..fab8a3035 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithTearDown/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With a test case that sleeps in a tearDown() method +--FILE-- +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithTearDownAfterClass/phpunit.xml b/test/EndToEnd/PHPUnit09/Console/TestCase/WithTearDownAfterClass/phpunit.xml new file mode 100644 index 000000000..1db3d3941 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithTearDownAfterClass/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithTearDownAfterClass/test.phpt b/test/EndToEnd/PHPUnit09/Console/TestCase/WithTearDownAfterClass/test.phpt new file mode 100644 index 000000000..6bb262213 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithTearDownAfterClass/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With a test case that sleeps in a tearDownAfterClass() method +--FILE-- + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/TestCase/WithoutTestMethods/test.phpt b/test/EndToEnd/PHPUnit09/Console/TestCase/WithoutTestMethods/test.phpt new file mode 100644 index 000000000..6a2248cd5 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestCase/WithoutTestMethods/test.phpt @@ -0,0 +1,21 @@ +--TEST-- +With a test case that has no test methods +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @maximumDuration 200 + * + * @slowThreshold 400 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit09/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit09/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml new file mode 100644 index 000000000..1db3d3941 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt b/test/EndToEnd/PHPUnit09/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt new file mode 100644 index 000000000..06d4f9ece --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With @maximumDuration and @slowThreshold annotations +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @maximumDuration 3.14 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidMaximumDurationAnnotation(): void + { + $milliseconds = 200; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @maximumDuration 200 + */ + public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideDataWhereDataNameIsInteger + * + * @maximumDuration 200 + */ + public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNumericDataProvider(): void + { + $milliseconds = 150; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return list + */ + public static function provideDataWhereDataNameIsInteger(): array + { + return [ + [ + 'bar', + ], + ]; + } + + /** + * @dataProvider provideDataWhereDataNameIsString + * + * @maximumDuration 200 + */ + public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNamedDataProvider(): void + { + $milliseconds = 150; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return array + */ + public static function provideDataWhereDataNameIsString(): array + { + return [ + 'foo' => [ + 'bar', + ], + ]; + } + + /** + * @maximumDuration 200 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit09/Console/TestMethod/WithMaximumDurationAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit09/Console/TestMethod/WithMaximumDurationAnnotation/phpunit.xml new file mode 100644 index 000000000..1db3d3941 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestMethod/WithMaximumDurationAnnotation/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/TestMethod/WithMaximumDurationAnnotation/test.phpt b/test/EndToEnd/PHPUnit09/Console/TestMethod/WithMaximumDurationAnnotation/test.phpt new file mode 100644 index 000000000..e011efe4e --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestMethod/WithMaximumDurationAnnotation/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With test methods with @maximumDuration annotations +--FILE-- +sleep(); + } + + public static function tearDownAfterClass(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function setUp(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPreConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPostConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function tearDown(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @before + */ + public function sleepWithBeforeAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @beforeClass + */ + public static function sleepWithBeforeClassAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @after + */ + public function sleepWithAfterAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @afterClass + */ + public static function sleepWithAfterClassAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @runInSeparateProcess + */ + public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation(): void + { + $milliseconds = 50; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 200; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @runInSeparateProcess + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit09/Console/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit09/Console/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml new file mode 100644 index 000000000..1db3d3941 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt b/test/EndToEnd/PHPUnit09/Console/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt new file mode 100644 index 000000000..f340e4dc2 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt @@ -0,0 +1,38 @@ +--TEST-- +With a test case that sleeps in data provider, hook, and test methods and has test methods with @runInSeparateProcess annotation +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 400 + * + * @maximumDuration 200 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit09/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit09/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml new file mode 100644 index 000000000..1db3d3941 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt b/test/EndToEnd/PHPUnit09/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt new file mode 100644 index 000000000..5008e18b0 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt @@ -0,0 +1,31 @@ +--TEST-- +With @maximumDuration and @slowThreshold annotations +--FILE-- +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 3.14 + * + * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidSlowThresholdAnnotation(): void + { + $milliseconds = 200; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 200 + * + * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 + */ + public function testSleeperSleepsShorterThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 200 + * + * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 + */ + public function testSleeperSleepsLongerThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit09/Console/TestMethod/WithSlowThresholdAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit09/Console/TestMethod/WithSlowThresholdAnnotation/phpunit.xml new file mode 100644 index 000000000..1db3d3941 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestMethod/WithSlowThresholdAnnotation/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + + 100 + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit09/Console/TestMethod/WithSlowThresholdAnnotation/test.phpt b/test/EndToEnd/PHPUnit09/Console/TestMethod/WithSlowThresholdAnnotation/test.phpt new file mode 100644 index 000000000..945bdf002 --- /dev/null +++ b/test/EndToEnd/PHPUnit09/Console/TestMethod/WithSlowThresholdAnnotation/test.phpt @@ -0,0 +1,32 @@ +--TEST-- +With test methods with @slowThreshold annotations +--FILE-- +sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit09/TestCase/Bare/phpunit.xml b/test/EndToEnd/PHPUnit09/TestCase/Bare/phpunit.xml deleted file mode 100644 index 7f7ff83b0..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/Bare/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/TestCase/Bare/test.phpt b/test/EndToEnd/PHPUnit09/TestCase/Bare/test.phpt deleted file mode 100644 index a807ec229..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/Bare/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that does not sleep in methods that are not test methods ---FILE-- -sleep(); - } - - public static function tearDownAfterClass(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function setUp(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPreConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPostConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function tearDown(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @before - */ - public function sleepWithBeforeAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @beforeClass - */ - public static function sleepWithBeforeClassAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @after - */ - public function sleepWithAfterAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @afterClass - */ - public static function sleepWithAfterClassAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit09/TestCase/Combination/phpunit.xml b/test/EndToEnd/PHPUnit09/TestCase/Combination/phpunit.xml deleted file mode 100644 index 7f7ff83b0..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/Combination/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/TestCase/Combination/test.phpt b/test/EndToEnd/PHPUnit09/TestCase/Combination/test.phpt deleted file mode 100644 index cfab3084a..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/Combination/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in data provider, hook, and test methods ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithAfterAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit09/TestCase/WithAfterAnnotation/phpunit.xml deleted file mode 100644 index 7f7ff83b0..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithAfterAnnotation/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithAfterAnnotation/test.phpt b/test/EndToEnd/PHPUnit09/TestCase/WithAfterAnnotation/test.phpt deleted file mode 100644 index 85e37d75e..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithAfterAnnotation/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with @after annotation ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithAfterClassAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit09/TestCase/WithAfterClassAnnotation/phpunit.xml deleted file mode 100644 index 7f7ff83b0..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithAfterClassAnnotation/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithAfterClassAnnotation/test.phpt b/test/EndToEnd/PHPUnit09/TestCase/WithAfterClassAnnotation/test.phpt deleted file mode 100644 index 6a5fbf2cb..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithAfterClassAnnotation/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with @afterClass annotation ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithAssertPostConditions/phpunit.xml b/test/EndToEnd/PHPUnit09/TestCase/WithAssertPostConditions/phpunit.xml deleted file mode 100644 index 7f7ff83b0..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithAssertPostConditions/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithAssertPostConditions/test.phpt b/test/EndToEnd/PHPUnit09/TestCase/WithAssertPostConditions/test.phpt deleted file mode 100644 index cdde24df9..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithAssertPostConditions/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in assertPostConditions() method ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithAssertPreConditions/phpunit.xml b/test/EndToEnd/PHPUnit09/TestCase/WithAssertPreConditions/phpunit.xml deleted file mode 100644 index 7f7ff83b0..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithAssertPreConditions/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithAssertPreConditions/test.phpt b/test/EndToEnd/PHPUnit09/TestCase/WithAssertPreConditions/test.phpt deleted file mode 100644 index 750f6d816..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithAssertPreConditions/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in assertPreConditions() method ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithBeforeAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit09/TestCase/WithBeforeAnnotation/phpunit.xml deleted file mode 100644 index 7f7ff83b0..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithBeforeAnnotation/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithBeforeAnnotation/test.phpt b/test/EndToEnd/PHPUnit09/TestCase/WithBeforeAnnotation/test.phpt deleted file mode 100644 index 793a27333..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithBeforeAnnotation/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with @before annotation ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithBeforeClassAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit09/TestCase/WithBeforeClassAnnotation/phpunit.xml deleted file mode 100644 index 7f7ff83b0..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithBeforeClassAnnotation/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithBeforeClassAnnotation/test.phpt b/test/EndToEnd/PHPUnit09/TestCase/WithBeforeClassAnnotation/test.phpt deleted file mode 100644 index c62c86051..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithBeforeClassAnnotation/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with @beforeClass annotation ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithDataProvider/phpunit.xml b/test/EndToEnd/PHPUnit09/TestCase/WithDataProvider/phpunit.xml deleted file mode 100644 index 7f7ff83b0..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithDataProvider/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithDataProvider/test.phpt b/test/EndToEnd/PHPUnit09/TestCase/WithDataProvider/test.phpt deleted file mode 100644 index 691b3bfb4..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithDataProvider/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that sleeps in a data provider ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithSetUp/phpunit.xml b/test/EndToEnd/PHPUnit09/TestCase/WithSetUp/phpunit.xml deleted file mode 100644 index 7f7ff83b0..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithSetUp/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithSetUp/test.phpt b/test/EndToEnd/PHPUnit09/TestCase/WithSetUp/test.phpt deleted file mode 100644 index 8ea94f50b..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithSetUp/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in a setUp() method ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithSetUpBeforeClass/phpunit.xml b/test/EndToEnd/PHPUnit09/TestCase/WithSetUpBeforeClass/phpunit.xml deleted file mode 100644 index 7f7ff83b0..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithSetUpBeforeClass/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithSetUpBeforeClass/test.phpt b/test/EndToEnd/PHPUnit09/TestCase/WithSetUpBeforeClass/test.phpt deleted file mode 100644 index e445a12fd..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithSetUpBeforeClass/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that sleeps in a setUpBeforeClass() method ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithTearDown/phpunit.xml b/test/EndToEnd/PHPUnit09/TestCase/WithTearDown/phpunit.xml deleted file mode 100644 index 7f7ff83b0..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithTearDown/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithTearDown/test.phpt b/test/EndToEnd/PHPUnit09/TestCase/WithTearDown/test.phpt deleted file mode 100644 index 06fa4b4fc..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithTearDown/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With a test case that sleeps in a tearDown() method ---FILE-- -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithTearDownAfterClass/phpunit.xml b/test/EndToEnd/PHPUnit09/TestCase/WithTearDownAfterClass/phpunit.xml deleted file mode 100644 index 7f7ff83b0..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithTearDownAfterClass/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithTearDownAfterClass/test.phpt b/test/EndToEnd/PHPUnit09/TestCase/WithTearDownAfterClass/test.phpt deleted file mode 100644 index 38cd414b4..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithTearDownAfterClass/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With a test case that sleeps in a tearDownAfterClass() method ---FILE-- - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/TestCase/WithoutTestMethods/test.phpt b/test/EndToEnd/PHPUnit09/TestCase/WithoutTestMethods/test.phpt deleted file mode 100644 index d26b67382..000000000 --- a/test/EndToEnd/PHPUnit09/TestCase/WithoutTestMethods/test.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -With a test case that has no test methods ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 200 - * - * @slowThreshold 400 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit09/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit09/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml deleted file mode 100644 index 7f7ff83b0..000000000 --- a/test/EndToEnd/PHPUnit09/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt b/test/EndToEnd/PHPUnit09/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt deleted file mode 100644 index 5be81d7ae..000000000 --- a/test/EndToEnd/PHPUnit09/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With @maximumDuration and @slowThreshold annotations ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 3.14 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidMaximumDurationAnnotation(): void - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 200 - */ - public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideDataWhereDataNameIsInteger - * - * @maximumDuration 200 - */ - public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNumericDataProvider(): void - { - $milliseconds = 150; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return list - */ - public static function provideDataWhereDataNameIsInteger(): array - { - return [ - [ - 'bar', - ], - ]; - } - - /** - * @dataProvider provideDataWhereDataNameIsString - * - * @maximumDuration 200 - */ - public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNamedDataProvider(): void - { - $milliseconds = 150; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return array - */ - public static function provideDataWhereDataNameIsString(): array - { - return [ - 'foo' => [ - 'bar', - ], - ]; - } - - /** - * @maximumDuration 200 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit09/TestMethod/WithMaximumDurationAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit09/TestMethod/WithMaximumDurationAnnotation/phpunit.xml deleted file mode 100644 index 7f7ff83b0..000000000 --- a/test/EndToEnd/PHPUnit09/TestMethod/WithMaximumDurationAnnotation/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/TestMethod/WithMaximumDurationAnnotation/test.phpt b/test/EndToEnd/PHPUnit09/TestMethod/WithMaximumDurationAnnotation/test.phpt deleted file mode 100644 index 619b40478..000000000 --- a/test/EndToEnd/PHPUnit09/TestMethod/WithMaximumDurationAnnotation/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With test methods with @maximumDuration annotations ---FILE-- -sleep(); - } - - public static function tearDownAfterClass(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function setUp(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPreConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPostConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function tearDown(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @before - */ - public function sleepWithBeforeAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @beforeClass - */ - public static function sleepWithBeforeClassAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @after - */ - public function sleepWithAfterAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @afterClass - */ - public static function sleepWithAfterClassAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @runInSeparateProcess - */ - public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation(): void - { - $milliseconds = 50; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @runInSeparateProcess - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit09/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit09/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml deleted file mode 100644 index 7f7ff83b0..000000000 --- a/test/EndToEnd/PHPUnit09/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt b/test/EndToEnd/PHPUnit09/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt deleted file mode 100644 index c6c7b5eb5..000000000 --- a/test/EndToEnd/PHPUnit09/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -With a test case that sleeps in data provider, hook, and test methods and has test methods with @runInSeparateProcess annotation ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 400 - * - * @maximumDuration 200 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit09/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit09/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml deleted file mode 100644 index 7f7ff83b0..000000000 --- a/test/EndToEnd/PHPUnit09/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt b/test/EndToEnd/PHPUnit09/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt deleted file mode 100644 index 4af17d1a7..000000000 --- a/test/EndToEnd/PHPUnit09/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -With @maximumDuration and @slowThreshold annotations ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 3.14 - * - * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidSlowThresholdAnnotation(): void - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 200 - * - * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 - */ - public function testSleeperSleepsShorterThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 200 - * - * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 - */ - public function testSleeperSleepsLongerThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit09/TestMethod/WithSlowThresholdAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit09/TestMethod/WithSlowThresholdAnnotation/phpunit.xml deleted file mode 100644 index 7f7ff83b0..000000000 --- a/test/EndToEnd/PHPUnit09/TestMethod/WithSlowThresholdAnnotation/phpunit.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - 100 - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit09/TestMethod/WithSlowThresholdAnnotation/test.phpt b/test/EndToEnd/PHPUnit09/TestMethod/WithSlowThresholdAnnotation/test.phpt deleted file mode 100644 index a1865de81..000000000 --- a/test/EndToEnd/PHPUnit09/TestMethod/WithSlowThresholdAnnotation/test.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -With test methods with @slowThreshold annotations ---FILE-- -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] - public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable - { - $values = \range( - 600, - 1600, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit10/Configuration/Defaults/phpunit.xml b/test/EndToEnd/PHPUnit10/Configuration/Defaults/phpunit.xml deleted file mode 100644 index 5e1710b58..000000000 --- a/test/EndToEnd/PHPUnit10/Configuration/Defaults/phpunit.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/Configuration/Defaults/test.phpt b/test/EndToEnd/PHPUnit10/Configuration/Defaults/test.phpt deleted file mode 100644 index 654c98fe2..000000000 --- a/test/EndToEnd/PHPUnit10/Configuration/Defaults/test.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -With default configuration ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -............ 12 / 12 (100%) - -Detected 11 tests where the duration exceeded the global maximum duration (0.500). - - # Duration Test ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 1 1.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #10 (1600) - 2 1.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #9 (1500) - 3 1.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #8 (1400) - 4 1.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #7 (1300) - 5 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #6 (1200) - 6 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #5 (1100) - 7 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #4 (1000) - 8 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #3 (900) - 9 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #2 (800) -10 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #1 (700) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -There is 1 additional slow test that is not listed here. - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/Configuration/MaximumCount/SleeperTest.php b/test/EndToEnd/PHPUnit10/Configuration/MaximumCount/SleeperTest.php deleted file mode 100644 index fe92ef629..000000000 --- a/test/EndToEnd/PHPUnit10/Configuration/MaximumCount/SleeperTest.php +++ /dev/null @@ -1,60 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] - public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable - { - $values = \range( - 600, - 1000, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit10/Configuration/MaximumCount/phpunit.xml b/test/EndToEnd/PHPUnit10/Configuration/MaximumCount/phpunit.xml deleted file mode 100644 index 45a04f8bf..000000000 --- a/test/EndToEnd/PHPUnit10/Configuration/MaximumCount/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/Configuration/MaximumCount/test.phpt b/test/EndToEnd/PHPUnit10/Configuration/MaximumCount/test.phpt deleted file mode 100644 index 1692c0a89..000000000 --- a/test/EndToEnd/PHPUnit10/Configuration/MaximumCount/test.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -With custom configuration setting the "maximum-count" parameter in the XML configuration file ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -...... 6 / 6 (100%) - -Detected 5 tests where the duration exceeded the global maximum duration (0.500). - -# Duration Test ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #4 (1000) -2 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #3 (900) -3 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #2 (800) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -There are 2 additional slow tests that are not listed here. - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/Configuration/MaximumDuration/SleeperTest.php b/test/EndToEnd/PHPUnit10/Configuration/MaximumDuration/SleeperTest.php deleted file mode 100644 index ff40de8ca..000000000 --- a/test/EndToEnd/PHPUnit10/Configuration/MaximumDuration/SleeperTest.php +++ /dev/null @@ -1,60 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 1200, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit10/Configuration/MaximumDuration/phpunit.xml b/test/EndToEnd/PHPUnit10/Configuration/MaximumDuration/phpunit.xml deleted file mode 100644 index 6e460c411..000000000 --- a/test/EndToEnd/PHPUnit10/Configuration/MaximumDuration/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/Configuration/MaximumDuration/test.phpt b/test/EndToEnd/PHPUnit10/Configuration/MaximumDuration/test.phpt deleted file mode 100644 index 7d0a36fd1..000000000 --- a/test/EndToEnd/PHPUnit10/Configuration/MaximumDuration/test.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -With custom configuration setting the "maximum-duration" parameter in the XML configuration file ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -............ 12 / 12 (100%) - -Detected 11 tests where the duration exceeded the global maximum duration (0.100). - - # Duration Test ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 1 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #10 (1200) - 2 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #9 (1100) - 3 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #8 (1000) - 4 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #7 (900) - 5 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #6 (800) - 6 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #5 (700) - 7 0.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #4 (600) - 8 0.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #3 (500) - 9 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #2 (400) -10 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -There is 1 additional slow test that is not listed here. - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/Configuration/Stderr/SleeperTest.php b/test/EndToEnd/PHPUnit10/Configuration/Stderr/SleeperTest.php deleted file mode 100644 index 914337622..000000000 --- a/test/EndToEnd/PHPUnit10/Configuration/Stderr/SleeperTest.php +++ /dev/null @@ -1,60 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] - public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable - { - $values = \range( - 600, - 1600, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit10/Configuration/Stderr/phpunit.xml b/test/EndToEnd/PHPUnit10/Configuration/Stderr/phpunit.xml deleted file mode 100644 index 8058ba599..000000000 --- a/test/EndToEnd/PHPUnit10/Configuration/Stderr/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/Configuration/Stderr/test.phpt b/test/EndToEnd/PHPUnit10/Configuration/Stderr/test.phpt deleted file mode 100644 index 4cd5be81c..000000000 --- a/test/EndToEnd/PHPUnit10/Configuration/Stderr/test.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -With configuration setting stderr to true ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -............ 12 / 12 (100%) - -Detected 11 tests where the duration exceeded the global maximum duration (0.500). - - # Duration Test --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 1 1.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #10 (1600) - 2 1.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #9 (1500) - 3 1.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #8 (1400) - 4 1.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #7 (1300) - 5 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #6 (1200) - 6 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #5 (1100) - 7 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #4 (1000) - 8 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #3 (900) - 9 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #2 (800) -10 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #1 (700) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -There is 1 additional slow test that is not listed here. - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/Console/Configuration/Defaults/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/Configuration/Defaults/SleeperTest.php new file mode 100644 index 000000000..8fd923aff --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/Configuration/Defaults/SleeperTest.php @@ -0,0 +1,60 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] + public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable + { + $values = \range( + 600, + 1600, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/Configuration/Defaults/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/Configuration/Defaults/phpunit.xml new file mode 100644 index 000000000..1d3186b09 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/Configuration/Defaults/phpunit.xml @@ -0,0 +1,32 @@ + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/Configuration/Defaults/test.phpt b/test/EndToEnd/PHPUnit10/Console/Configuration/Defaults/test.phpt new file mode 100644 index 000000000..7e73f0abe --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/Configuration/Defaults/test.phpt @@ -0,0 +1,43 @@ +--TEST-- +With default configuration +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +............ 12 / 12 (100%) + +Detected 11 tests where the duration exceeded the global maximum duration (0.500). + + # Duration Test +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 1 1.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #10 (1600) + 2 1.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #9 (1500) + 3 1.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #8 (1400) + 4 1.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #7 (1300) + 5 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #6 (1200) + 6 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #5 (1100) + 7 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #4 (1000) + 8 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #3 (900) + 9 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #2 (800) +10 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #1 (700) +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 0.000 + └─── seconds + +There is 1 additional slow test that is not listed here. + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/Configuration/MaximumCount/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/Configuration/MaximumCount/SleeperTest.php new file mode 100644 index 000000000..f05754ad2 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/Configuration/MaximumCount/SleeperTest.php @@ -0,0 +1,60 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] + public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable + { + $values = \range( + 600, + 1000, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/Configuration/MaximumCount/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/Configuration/MaximumCount/phpunit.xml new file mode 100644 index 000000000..3e6d475af --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/Configuration/MaximumCount/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/Configuration/MaximumCount/test.phpt b/test/EndToEnd/PHPUnit10/Console/Configuration/MaximumCount/test.phpt new file mode 100644 index 000000000..1ade8c565 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/Configuration/MaximumCount/test.phpt @@ -0,0 +1,36 @@ +--TEST-- +With custom configuration setting the "maximum-count" parameter in the XML configuration file +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +...... 6 / 6 (100%) + +Detected 5 tests where the duration exceeded the global maximum duration (0.500). + +# Duration Test +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #4 (1000) +2 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #3 (900) +3 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #2 (800) +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +There are 2 additional slow tests that are not listed here. + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/Configuration/MaximumDuration/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/Configuration/MaximumDuration/SleeperTest.php new file mode 100644 index 000000000..a5ce7db0a --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/Configuration/MaximumDuration/SleeperTest.php @@ -0,0 +1,60 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 1200, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/Configuration/MaximumDuration/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/Configuration/MaximumDuration/phpunit.xml new file mode 100644 index 000000000..dadbe8e9c --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/Configuration/MaximumDuration/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/Configuration/MaximumDuration/test.phpt b/test/EndToEnd/PHPUnit10/Console/Configuration/MaximumDuration/test.phpt new file mode 100644 index 000000000..dba6f29e7 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/Configuration/MaximumDuration/test.phpt @@ -0,0 +1,43 @@ +--TEST-- +With custom configuration setting the "maximum-duration" parameter in the XML configuration file +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +............ 12 / 12 (100%) + +Detected 11 tests where the duration exceeded the global maximum duration (0.100). + + # Duration Test +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 1 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #10 (1200) + 2 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #9 (1100) + 3 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #8 (1000) + 4 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #7 (900) + 5 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #6 (800) + 6 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #5 (700) + 7 0.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #4 (600) + 8 0.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #3 (500) + 9 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #2 (400) +10 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +There is 1 additional slow test that is not listed here. + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/Configuration/Stderr/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/Configuration/Stderr/SleeperTest.php new file mode 100644 index 000000000..c50922808 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/Configuration/Stderr/SleeperTest.php @@ -0,0 +1,60 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] + public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable + { + $values = \range( + 600, + 1600, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/Configuration/Stderr/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/Configuration/Stderr/phpunit.xml new file mode 100644 index 000000000..2b4ce1f5f --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/Configuration/Stderr/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/Configuration/Stderr/test.phpt b/test/EndToEnd/PHPUnit10/Console/Configuration/Stderr/test.phpt new file mode 100644 index 000000000..0fcc6d72a --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/Configuration/Stderr/test.phpt @@ -0,0 +1,43 @@ +--TEST-- +With configuration setting stderr to true +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +............ 12 / 12 (100%) + +Detected 11 tests where the duration exceeded the global maximum duration (0.500). + + # Duration Test +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 1 1.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #10 (1600) + 2 1.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #9 (1500) + 3 1.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #8 (1400) + 4 1.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #7 (1300) + 5 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #6 (1200) + 6 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #5 (1100) + 7 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #4 (1000) + 8 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #3 (900) + 9 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #2 (800) +10 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #1 (700) +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +There is 1 additional slow test that is not listed here. + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/Option/NoOutput/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/Option/NoOutput/SleeperTest.php new file mode 100644 index 000000000..4ec0bacc8 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/Option/NoOutput/SleeperTest.php @@ -0,0 +1,32 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/Option/NoOutput/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/Option/NoOutput/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/Option/NoOutput/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/Option/NoOutput/test.phpt b/test/EndToEnd/PHPUnit10/Console/Option/NoOutput/test.phpt new file mode 100644 index 000000000..a239f5d28 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/Option/NoOutput/test.phpt @@ -0,0 +1,18 @@ +--TEST-- +With default configuration of extension +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/Bare/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestCase/Bare/SleeperTest.php new file mode 100644 index 000000000..454445a2f --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/Bare/SleeperTest.php @@ -0,0 +1,60 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/Bare/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestCase/Bare/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/Bare/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/Bare/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestCase/Bare/test.phpt new file mode 100644 index 000000000..11f86b1ad --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/Bare/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that does not sleep in methods that are not test methods +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\Bare\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\Bare\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/Combination/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestCase/Combination/SleeperTest.php new file mode 100644 index 000000000..774921a05 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/Combination/SleeperTest.php @@ -0,0 +1,148 @@ +sleep(); + } + + public static function tearDownAfterClass(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function setUp(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPreConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPostConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function tearDown(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @before + */ + public function sleepWithBeforeAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\Before] + public function sleepWithBeforeAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @after + */ + public function sleepWithAfterAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @beforeClass + */ + public function sleepWithBeforeClassAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\BeforeClass] + public function sleepWithBeforeClassAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\After] + public function sleepWithAfterAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @afterClass + */ + public function sleepWithAfterClassAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\AfterClass] + public function sleepWithAfterClassAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/Combination/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestCase/Combination/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/Combination/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/Combination/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestCase/Combination/test.phpt new file mode 100644 index 000000000..63eb2c0bd --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/Combination/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in data provider, hook, and test methods +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 1.%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\Combination\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 1.%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\Combination\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +3 0.%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\Combination\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterAnnotation/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterAnnotation/SleeperTest.php new file mode 100644 index 000000000..6d4f7cd5e --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterAnnotation/SleeperTest.php @@ -0,0 +1,68 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterAnnotation/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterAnnotation/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterAnnotation/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterAnnotation/test.phpt new file mode 100644 index 000000000..2acb2aa43 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterAnnotation/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in a method with @after annotation +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithAfterAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithAfterAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithAfterAnnotation\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterAttribute/SleeperTest.php new file mode 100644 index 000000000..02a6fc836 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterAttribute/SleeperTest.php @@ -0,0 +1,66 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterAttribute/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterAttribute/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterAttribute/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterAttribute/test.phpt new file mode 100644 index 000000000..2aae5ca11 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterAttribute/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in a method with After attribute +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterClassAnnotation/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterClassAnnotation/SleeperTest.php new file mode 100644 index 000000000..89c7f6adf --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterClassAnnotation/SleeperTest.php @@ -0,0 +1,68 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterClassAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterClassAnnotation/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterClassAnnotation/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterClassAnnotation/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterClassAnnotation/test.phpt new file mode 100644 index 000000000..b4eb28df5 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterClassAnnotation/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a method with @afterClass annotation +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithAfterClassAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithAfterClassAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterClassAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterClassAttribute/SleeperTest.php new file mode 100644 index 000000000..d0a443ad5 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterClassAttribute/SleeperTest.php @@ -0,0 +1,66 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterClassAttribute/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterClassAttribute/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterClassAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterClassAttribute/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterClassAttribute/test.phpt new file mode 100644 index 000000000..70ec07241 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAfterClassAttribute/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a method with AfterClass attribute +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithAfterClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithAfterClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithAssertPostConditions/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAssertPostConditions/SleeperTest.php new file mode 100644 index 000000000..aee8896e2 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAssertPostConditions/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithAssertPostConditions/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAssertPostConditions/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAssertPostConditions/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithAssertPostConditions/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAssertPostConditions/test.phpt new file mode 100644 index 000000000..0c09e875e --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAssertPostConditions/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in assertPostConditions() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithAssertPreConditions/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAssertPreConditions/SleeperTest.php new file mode 100644 index 000000000..60f23c641 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAssertPreConditions/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithAssertPreConditions/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAssertPreConditions/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAssertPreConditions/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithAssertPreConditions/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAssertPreConditions/test.phpt new file mode 100644 index 000000000..bab994f65 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithAssertPreConditions/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in assertPreConditions() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeAnnotation/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeAnnotation/SleeperTest.php new file mode 100644 index 000000000..fdb3f0dd5 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeAnnotation/SleeperTest.php @@ -0,0 +1,68 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeAnnotation/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeAnnotation/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeAnnotation/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeAnnotation/test.phpt new file mode 100644 index 000000000..876e6d0d8 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeAnnotation/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in a method with @before annotation +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithBeforeAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithBeforeAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithBeforeAnnotation\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeAttribute/SleeperTest.php new file mode 100644 index 000000000..e42f779a4 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeAttribute/SleeperTest.php @@ -0,0 +1,66 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeAttribute/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeAttribute/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeAttribute/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeAttribute/test.phpt new file mode 100644 index 000000000..5a86d4a94 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeAttribute/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in a method with Before attribute +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeClassAnnotation/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeClassAnnotation/SleeperTest.php new file mode 100644 index 000000000..6addcf7b1 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeClassAnnotation/SleeperTest.php @@ -0,0 +1,68 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeClassAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeClassAnnotation/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeClassAnnotation/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeClassAnnotation/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeClassAnnotation/test.phpt new file mode 100644 index 000000000..601694d62 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeClassAnnotation/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a method with @beforeClass annotation +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithBeforeClassAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithBeforeClassAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeClassAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeClassAttribute/SleeperTest.php new file mode 100644 index 000000000..36610fac7 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeClassAttribute/SleeperTest.php @@ -0,0 +1,66 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeClassAttribute/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeClassAttribute/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeClassAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeClassAttribute/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeClassAttribute/test.phpt new file mode 100644 index 000000000..604102387 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithBeforeClassAttribute/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a method with BeforeClass attribute +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithBeforeClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithBeforeClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithDataProvider/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestCase/WithDataProvider/SleeperTest.php new file mode 100644 index 000000000..2012c3f5e --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithDataProvider/SleeperTest.php @@ -0,0 +1,62 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithDataProvider/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestCase/WithDataProvider/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithDataProvider/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithDataProvider/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestCase/WithDataProvider/test.phpt new file mode 100644 index 000000000..f1ba26958 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithDataProvider/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a data provider method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithDataProvider\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithDataProvider\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithSetUp/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestCase/WithSetUp/SleeperTest.php new file mode 100644 index 000000000..8dac0564f --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithSetUp/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithSetUp/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestCase/WithSetUp/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithSetUp/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithSetUp/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestCase/WithSetUp/test.phpt new file mode 100644 index 000000000..e25a685e8 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithSetUp/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in a setUp() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithSetUpBeforeClass/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestCase/WithSetUpBeforeClass/SleeperTest.php new file mode 100644 index 000000000..b436c2840 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithSetUpBeforeClass/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithSetUpBeforeClass/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestCase/WithSetUpBeforeClass/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithSetUpBeforeClass/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithSetUpBeforeClass/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestCase/WithSetUpBeforeClass/test.phpt new file mode 100644 index 000000000..a85ac6303 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithSetUpBeforeClass/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a setUpBeforeClass() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithSetUpBeforeClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithSetUpBeforeClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithTearDown/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestCase/WithTearDown/SleeperTest.php new file mode 100644 index 000000000..91bdb0b8b --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithTearDown/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithTearDown/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestCase/WithTearDown/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithTearDown/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithTearDown/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestCase/WithTearDown/test.phpt new file mode 100644 index 000000000..e5cf81def --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithTearDown/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in a tearDown() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithTearDownAfterClass/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestCase/WithTearDownAfterClass/SleeperTest.php new file mode 100644 index 000000000..2c9afb91c --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithTearDownAfterClass/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithTearDownAfterClass/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestCase/WithTearDownAfterClass/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithTearDownAfterClass/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithTearDownAfterClass/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestCase/WithTearDownAfterClass/test.phpt new file mode 100644 index 000000000..f14a6431d --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithTearDownAfterClass/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a tearDownAfterClass() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithTearDownAfterClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithTearDownAfterClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithoutTestMethods/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestCase/WithoutTestMethods/SleeperTest.php new file mode 100644 index 000000000..c3a92fdeb --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithoutTestMethods/SleeperTest.php @@ -0,0 +1,23 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestCase/WithoutTestMethods/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestCase/WithoutTestMethods/test.phpt new file mode 100644 index 000000000..79c1fece9 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestCase/WithoutTestMethods/test.phpt @@ -0,0 +1,24 @@ +--TEST-- +With a test case that has no test methods +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +There was 1 PHPUnit%swarning: + +1) No tests found in class "Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestCase\WithoutTestMethods\SleeperTest". + +No tests executed! diff --git a/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/SleeperTest.php new file mode 100644 index 000000000..0a8f257a5 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/SleeperTest.php @@ -0,0 +1,53 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @maximumDuration 200 + * + * @slowThreshold 400 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt new file mode 100644 index 000000000..fe03e8cda --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With @maximumDuration and @slowThreshold annotations +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +.. 2 / 2 (100%) + +Detected 1 test where the duration exceeded a custom or the global maximum duration (0.100). + +# Duration Test + Actual Maximum +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestMethod\WithMaximumDurationAndSlowThresholdAnnotations\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAnnotation/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAnnotation/SleeperTest.php new file mode 100644 index 000000000..91cd2120a --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAnnotation/SleeperTest.php @@ -0,0 +1,133 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @maximumDuration 3.14 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidMaximumDurationAnnotation(): void + { + $milliseconds = 200; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @maximumDuration 200 + */ + public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideDataWhereDataNameIsInteger + * + * @maximumDuration 200 + */ + public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNumericDataProvider(): void + { + $milliseconds = 150; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return list + */ + public static function provideDataWhereDataNameIsInteger(): array + { + return [ + [ + 'bar', + ], + ]; + } + + /** + * @dataProvider provideDataWhereDataNameIsString + * + * @maximumDuration 200 + */ + public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNamedDataProvider(): void + { + $milliseconds = 150; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return array + */ + public static function provideDataWhereDataNameIsString(): array + { + return [ + 'foo' => [ + 'bar', + ], + ]; + } + + /** + * @maximumDuration 200 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAnnotation/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAnnotation/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAnnotation/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAnnotation/test.phpt new file mode 100644 index 000000000..4c94e17a3 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAnnotation/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With test methods with @maximumDuration annotations +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +...... 6 / 6 (100%) + +Detected 2 tests where the duration exceeded a custom or the global maximum duration (0.100). + +# Duration Test + Actual Maximum +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestMethod\WithMaximumDurationAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestMethod\WithMaximumDurationAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidMaximumDurationAnnotation +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAttribute/SleeperTest.php new file mode 100644 index 000000000..4a14504ed --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAttribute/SleeperTest.php @@ -0,0 +1,46 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Attribute\MaximumDuration(200)] + public function testSleeperSleepsLongerThanMaximumDurationFromAttributeWhenTestMethodHasValidMaximumDurationAttribute(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAttribute/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAttribute/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAttribute/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAttribute/test.phpt new file mode 100644 index 000000000..b1b5ab1d3 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithMaximumDurationAttribute/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With test methods with @maximumDuration Attributes +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +.. 2 / 2 (100%) + +Detected 1 test where the duration exceeded a custom or the global maximum duration (0.100). + +# Duration Test + Actual Maximum +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestMethod\WithMaximumDurationAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromAttributeWhenTestMethodHasValidMaximumDurationAttribute +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestMethod/WithRunInSeparateProcessAnnotation/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithRunInSeparateProcessAnnotation/SleeperTest.php new file mode 100644 index 000000000..09ac672fe --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithRunInSeparateProcessAnnotation/SleeperTest.php @@ -0,0 +1,157 @@ +sleep(); + } + + public static function tearDownAfterClass(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function setUp(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPreConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPostConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function tearDown(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @before + */ + public function sleepWithBeforeAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\Before] + public function sleepWithBeforeAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @after + */ + public function sleepWithAfterAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\After] + public function sleepWithAfterAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @beforeClass + */ + public function sleepWithBeforeClassAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\BeforeClass] + public function sleepWithBeforeClassAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @afterClass + */ + public function sleepWithAfterClassAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\AfterClass] + public function sleepWithAfterClassAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @runInSeparateProcess + */ + public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation(): void + { + $milliseconds = 50; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 200; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @runInSeparateProcess + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt new file mode 100644 index 000000000..877ba78ce --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt @@ -0,0 +1,40 @@ +--TEST-- +With a test case that sleeps in data provider, hook, and test methods and has test methods with @runInSeparateProcess annotation +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +.... 4 / 4 (100%) + +Detected 4 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestMethod\WithRunInSeparateProcessAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation +2 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestMethod\WithRunInSeparateProcessAnnotation\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation +3 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestMethod\WithRunInSeparateProcessAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration +4 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestMethod\WithRunInSeparateProcessAnnotation\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php new file mode 100644 index 000000000..08bcbcc0f --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php @@ -0,0 +1,153 @@ +sleep(); + } + + public static function tearDownAfterClass(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function setUp(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPreConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPostConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function tearDown(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @before + */ + public function sleepWithBeforeAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\Before] + public function sleepWithBeforeAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @beforeClass + */ + public function sleepWithBeforeClassAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\BeforeClass] + public function sleepWithBeforeClassAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @after + */ + public function sleepWithAfterAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\After] + public function sleepWithAfterAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + /** + * @afterClass + */ + public function sleepWithAfterClassAnnotation(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\AfterClass] + public function sleepWithAfterClassAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\RunInSeparateProcess] + public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute(): void + { + $milliseconds = 50; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 200; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\RunInSeparateProcess] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestMethod/WithRunInSeparateProcessAttribute/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithRunInSeparateProcessAttribute/test.phpt new file mode 100644 index 000000000..5be64d9ee --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithRunInSeparateProcessAttribute/test.phpt @@ -0,0 +1,40 @@ +--TEST-- +With a test case that sleeps in data provider, hook, and test methods and has test methods with RunInSeparateProcess attribute +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +.... 4 / 4 (100%) + +Detected 4 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +1 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute +2 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute +3 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration +4 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/SleeperTest.php new file mode 100644 index 000000000..e5433c35e --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/SleeperTest.php @@ -0,0 +1,53 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 400 + * + * @maximumDuration 200 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt new file mode 100644 index 000000000..f5c59ae67 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With @maximumDuration and @slowThreshold annotations +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +.. 2 / 2 (100%) + +Detected 1 test where the duration exceeded a custom or the global maximum duration (0.100). + +# Duration Test + Actual Maximum +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestMethod\WithSlowThresholdAndMaximumDurationAnnotations\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Console/TestMethod/WithSlowThresholdAnnotation/SleeperTest.php b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithSlowThresholdAnnotation/SleeperTest.php new file mode 100644 index 000000000..27e2077b2 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithSlowThresholdAnnotation/SleeperTest.php @@ -0,0 +1,85 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 3.14 + * + * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidSlowThresholdAnnotation(): void + { + $milliseconds = 200; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 200 + * + * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 + */ + public function testSleeperSleepsShorterThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 200 + * + * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 + */ + public function testSleeperSleepsLongerThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit10/Console/TestMethod/WithSlowThresholdAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithSlowThresholdAnnotation/phpunit.xml new file mode 100644 index 000000000..a02142672 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithSlowThresholdAnnotation/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit10/Console/TestMethod/WithSlowThresholdAnnotation/test.phpt b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithSlowThresholdAnnotation/test.phpt new file mode 100644 index 000000000..a7c439d92 --- /dev/null +++ b/test/EndToEnd/PHPUnit10/Console/TestMethod/WithSlowThresholdAnnotation/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With test methods with @slowThreshold annotations +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +.... 4 / 4 (100%) + +Detected 2 tests where the duration exceeded a custom or the global maximum duration (0.100). + +# Duration Test + Actual Maximum +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestMethod\WithSlowThresholdAnnotation\SleeperTest::testSleeperSleepsLongerThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\Console\TestMethod\WithSlowThresholdAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidSlowThresholdAnnotation +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit10/Option/NoOutput/SleeperTest.php b/test/EndToEnd/PHPUnit10/Option/NoOutput/SleeperTest.php deleted file mode 100644 index 5fd27d02e..000000000 --- a/test/EndToEnd/PHPUnit10/Option/NoOutput/SleeperTest.php +++ /dev/null @@ -1,32 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit10/Option/NoOutput/phpunit.xml b/test/EndToEnd/PHPUnit10/Option/NoOutput/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/Option/NoOutput/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/Option/NoOutput/test.phpt b/test/EndToEnd/PHPUnit10/Option/NoOutput/test.phpt deleted file mode 100644 index 704152df7..000000000 --- a/test/EndToEnd/PHPUnit10/Option/NoOutput/test.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -With default configuration of extension ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- diff --git a/test/EndToEnd/PHPUnit10/TestCase/Bare/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestCase/Bare/SleeperTest.php deleted file mode 100644 index b49a648fb..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/Bare/SleeperTest.php +++ /dev/null @@ -1,60 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit10/TestCase/Bare/phpunit.xml b/test/EndToEnd/PHPUnit10/TestCase/Bare/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/Bare/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestCase/Bare/test.phpt b/test/EndToEnd/PHPUnit10/TestCase/Bare/test.phpt deleted file mode 100644 index 785da630f..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/Bare/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that does not sleep in methods that are not test methods ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\Bare\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\Bare\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestCase/Combination/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestCase/Combination/SleeperTest.php deleted file mode 100644 index 4f9f09ac6..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/Combination/SleeperTest.php +++ /dev/null @@ -1,148 +0,0 @@ -sleep(); - } - - public static function tearDownAfterClass(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function setUp(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPreConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPostConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function tearDown(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @before - */ - public function sleepWithBeforeAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\Before] - public function sleepWithBeforeAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @after - */ - public function sleepWithAfterAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @beforeClass - */ - public function sleepWithBeforeClassAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\BeforeClass] - public function sleepWithBeforeClassAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\After] - public function sleepWithAfterAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @afterClass - */ - public function sleepWithAfterClassAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\AfterClass] - public function sleepWithAfterClassAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit10/TestCase/Combination/phpunit.xml b/test/EndToEnd/PHPUnit10/TestCase/Combination/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/Combination/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestCase/Combination/test.phpt b/test/EndToEnd/PHPUnit10/TestCase/Combination/test.phpt deleted file mode 100644 index 49f8329f6..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/Combination/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in data provider, hook, and test methods ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 1.%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\Combination\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 1.%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\Combination\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) -3 0.%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\Combination\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithAfterAnnotation/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestCase/WithAfterAnnotation/SleeperTest.php deleted file mode 100644 index 27cfc3e95..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithAfterAnnotation/SleeperTest.php +++ /dev/null @@ -1,68 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithAfterAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit10/TestCase/WithAfterAnnotation/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithAfterAnnotation/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithAfterAnnotation/test.phpt b/test/EndToEnd/PHPUnit10/TestCase/WithAfterAnnotation/test.phpt deleted file mode 100644 index 5d67f8538..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithAfterAnnotation/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with @after annotation ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithAfterAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithAfterAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithAfterAnnotation\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithAfterAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestCase/WithAfterAttribute/SleeperTest.php deleted file mode 100644 index c831af936..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithAfterAttribute/SleeperTest.php +++ /dev/null @@ -1,66 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithAfterAttribute/phpunit.xml b/test/EndToEnd/PHPUnit10/TestCase/WithAfterAttribute/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithAfterAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithAfterAttribute/test.phpt b/test/EndToEnd/PHPUnit10/TestCase/WithAfterAttribute/test.phpt deleted file mode 100644 index 64bb8f3d4..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithAfterAttribute/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with After attribute ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithAfterClassAnnotation/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestCase/WithAfterClassAnnotation/SleeperTest.php deleted file mode 100644 index 6b599d966..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithAfterClassAnnotation/SleeperTest.php +++ /dev/null @@ -1,68 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithAfterClassAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit10/TestCase/WithAfterClassAnnotation/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithAfterClassAnnotation/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithAfterClassAnnotation/test.phpt b/test/EndToEnd/PHPUnit10/TestCase/WithAfterClassAnnotation/test.phpt deleted file mode 100644 index c59870c0a..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithAfterClassAnnotation/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with @afterClass annotation ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithAfterClassAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithAfterClassAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithAfterClassAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestCase/WithAfterClassAttribute/SleeperTest.php deleted file mode 100644 index 13ca0cf09..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithAfterClassAttribute/SleeperTest.php +++ /dev/null @@ -1,66 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithAfterClassAttribute/phpunit.xml b/test/EndToEnd/PHPUnit10/TestCase/WithAfterClassAttribute/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithAfterClassAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithAfterClassAttribute/test.phpt b/test/EndToEnd/PHPUnit10/TestCase/WithAfterClassAttribute/test.phpt deleted file mode 100644 index 2ed9271a4..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithAfterClassAttribute/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with AfterClass attribute ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithAfterClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithAfterClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithAssertPostConditions/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestCase/WithAssertPostConditions/SleeperTest.php deleted file mode 100644 index 1639ba61e..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithAssertPostConditions/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithAssertPostConditions/phpunit.xml b/test/EndToEnd/PHPUnit10/TestCase/WithAssertPostConditions/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithAssertPostConditions/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithAssertPostConditions/test.phpt b/test/EndToEnd/PHPUnit10/TestCase/WithAssertPostConditions/test.phpt deleted file mode 100644 index 88db6697e..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithAssertPostConditions/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in assertPostConditions() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithAssertPreConditions/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestCase/WithAssertPreConditions/SleeperTest.php deleted file mode 100644 index 833885185..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithAssertPreConditions/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithAssertPreConditions/phpunit.xml b/test/EndToEnd/PHPUnit10/TestCase/WithAssertPreConditions/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithAssertPreConditions/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithAssertPreConditions/test.phpt b/test/EndToEnd/PHPUnit10/TestCase/WithAssertPreConditions/test.phpt deleted file mode 100644 index 511fc63da..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithAssertPreConditions/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in assertPreConditions() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeAnnotation/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestCase/WithBeforeAnnotation/SleeperTest.php deleted file mode 100644 index e92532d47..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeAnnotation/SleeperTest.php +++ /dev/null @@ -1,68 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit10/TestCase/WithBeforeAnnotation/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeAnnotation/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeAnnotation/test.phpt b/test/EndToEnd/PHPUnit10/TestCase/WithBeforeAnnotation/test.phpt deleted file mode 100644 index e6b1bf27f..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeAnnotation/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with @before annotation ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithBeforeAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithBeforeAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithBeforeAnnotation\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestCase/WithBeforeAttribute/SleeperTest.php deleted file mode 100644 index f2ff547a1..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeAttribute/SleeperTest.php +++ /dev/null @@ -1,66 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeAttribute/phpunit.xml b/test/EndToEnd/PHPUnit10/TestCase/WithBeforeAttribute/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeAttribute/test.phpt b/test/EndToEnd/PHPUnit10/TestCase/WithBeforeAttribute/test.phpt deleted file mode 100644 index 29d5b9cc1..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeAttribute/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with Before attribute ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeClassAnnotation/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestCase/WithBeforeClassAnnotation/SleeperTest.php deleted file mode 100644 index 2d51d91ac..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeClassAnnotation/SleeperTest.php +++ /dev/null @@ -1,68 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeClassAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit10/TestCase/WithBeforeClassAnnotation/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeClassAnnotation/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeClassAnnotation/test.phpt b/test/EndToEnd/PHPUnit10/TestCase/WithBeforeClassAnnotation/test.phpt deleted file mode 100644 index 10ecb8d75..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeClassAnnotation/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with @beforeClass annotation ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithBeforeClassAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithBeforeClassAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeClassAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestCase/WithBeforeClassAttribute/SleeperTest.php deleted file mode 100644 index a2929cf68..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeClassAttribute/SleeperTest.php +++ /dev/null @@ -1,66 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeClassAttribute/phpunit.xml b/test/EndToEnd/PHPUnit10/TestCase/WithBeforeClassAttribute/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeClassAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeClassAttribute/test.phpt b/test/EndToEnd/PHPUnit10/TestCase/WithBeforeClassAttribute/test.phpt deleted file mode 100644 index d3b0ae933..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithBeforeClassAttribute/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with BeforeClass attribute ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithBeforeClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithBeforeClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithDataProvider/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestCase/WithDataProvider/SleeperTest.php deleted file mode 100644 index dbaed56c7..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithDataProvider/SleeperTest.php +++ /dev/null @@ -1,62 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithDataProvider/phpunit.xml b/test/EndToEnd/PHPUnit10/TestCase/WithDataProvider/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithDataProvider/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithDataProvider/test.phpt b/test/EndToEnd/PHPUnit10/TestCase/WithDataProvider/test.phpt deleted file mode 100644 index b35169d26..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithDataProvider/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a data provider method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithDataProvider\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithDataProvider\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithSetUp/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestCase/WithSetUp/SleeperTest.php deleted file mode 100644 index c6598d0f3..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithSetUp/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithSetUp/phpunit.xml b/test/EndToEnd/PHPUnit10/TestCase/WithSetUp/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithSetUp/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithSetUp/test.phpt b/test/EndToEnd/PHPUnit10/TestCase/WithSetUp/test.phpt deleted file mode 100644 index 84c3eae41..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithSetUp/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in a setUp() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithSetUpBeforeClass/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestCase/WithSetUpBeforeClass/SleeperTest.php deleted file mode 100644 index 38dcb3d69..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithSetUpBeforeClass/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithSetUpBeforeClass/phpunit.xml b/test/EndToEnd/PHPUnit10/TestCase/WithSetUpBeforeClass/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithSetUpBeforeClass/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithSetUpBeforeClass/test.phpt b/test/EndToEnd/PHPUnit10/TestCase/WithSetUpBeforeClass/test.phpt deleted file mode 100644 index e8a53ed20..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithSetUpBeforeClass/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a setUpBeforeClass() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithSetUpBeforeClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithSetUpBeforeClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithTearDown/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestCase/WithTearDown/SleeperTest.php deleted file mode 100644 index 6a3b7c15c..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithTearDown/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithTearDown/phpunit.xml b/test/EndToEnd/PHPUnit10/TestCase/WithTearDown/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithTearDown/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithTearDown/test.phpt b/test/EndToEnd/PHPUnit10/TestCase/WithTearDown/test.phpt deleted file mode 100644 index 404983107..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithTearDown/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in a tearDown() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithTearDownAfterClass/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestCase/WithTearDownAfterClass/SleeperTest.php deleted file mode 100644 index 980ab87d2..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithTearDownAfterClass/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithTearDownAfterClass/phpunit.xml b/test/EndToEnd/PHPUnit10/TestCase/WithTearDownAfterClass/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithTearDownAfterClass/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithTearDownAfterClass/test.phpt b/test/EndToEnd/PHPUnit10/TestCase/WithTearDownAfterClass/test.phpt deleted file mode 100644 index 5f56dc1dd..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithTearDownAfterClass/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a tearDownAfterClass() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithTearDownAfterClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithTearDownAfterClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithoutTestMethods/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestCase/WithoutTestMethods/SleeperTest.php deleted file mode 100644 index 9a44e1932..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithoutTestMethods/SleeperTest.php +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestCase/WithoutTestMethods/test.phpt b/test/EndToEnd/PHPUnit10/TestCase/WithoutTestMethods/test.phpt deleted file mode 100644 index 45e20893b..000000000 --- a/test/EndToEnd/PHPUnit10/TestCase/WithoutTestMethods/test.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -With a test case that has no test methods ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -There was 1 PHPUnit%swarning: - -1) No tests found in class "Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestCase\WithoutTestMethods\SleeperTest". - -No tests executed! diff --git a/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/SleeperTest.php deleted file mode 100644 index cafd514a9..000000000 --- a/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/SleeperTest.php +++ /dev/null @@ -1,53 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 200 - * - * @slowThreshold 400 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt b/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt deleted file mode 100644 index 0a7bade9e..000000000 --- a/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With @maximumDuration and @slowThreshold annotations ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -.. 2 / 2 (100%) - -Detected 1 test where the duration exceeded a custom or the global maximum duration (0.100). - -# Duration Test - Actual Maximum ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestMethod\WithMaximumDurationAndSlowThresholdAnnotations\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAnnotation/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAnnotation/SleeperTest.php deleted file mode 100644 index 936682a4b..000000000 --- a/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAnnotation/SleeperTest.php +++ /dev/null @@ -1,133 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 3.14 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidMaximumDurationAnnotation(): void - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 200 - */ - public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideDataWhereDataNameIsInteger - * - * @maximumDuration 200 - */ - public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNumericDataProvider(): void - { - $milliseconds = 150; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return list - */ - public static function provideDataWhereDataNameIsInteger(): array - { - return [ - [ - 'bar', - ], - ]; - } - - /** - * @dataProvider provideDataWhereDataNameIsString - * - * @maximumDuration 200 - */ - public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNamedDataProvider(): void - { - $milliseconds = 150; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return array - */ - public static function provideDataWhereDataNameIsString(): array - { - return [ - 'foo' => [ - 'bar', - ], - ]; - } - - /** - * @maximumDuration 200 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAnnotation/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAnnotation/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAnnotation/test.phpt b/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAnnotation/test.phpt deleted file mode 100644 index e4af3fc8a..000000000 --- a/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAnnotation/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With test methods with @maximumDuration annotations ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -...... 6 / 6 (100%) - -Detected 2 tests where the duration exceeded a custom or the global maximum duration (0.100). - -# Duration Test - Actual Maximum ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestMethod\WithMaximumDurationAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestMethod\WithMaximumDurationAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidMaximumDurationAnnotation ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAttribute/SleeperTest.php deleted file mode 100644 index f0756fbb2..000000000 --- a/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAttribute/SleeperTest.php +++ /dev/null @@ -1,46 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Attribute\MaximumDuration(200)] - public function testSleeperSleepsLongerThanMaximumDurationFromAttributeWhenTestMethodHasValidMaximumDurationAttribute(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAttribute/phpunit.xml b/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAttribute/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAttribute/test.phpt b/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAttribute/test.phpt deleted file mode 100644 index 3662be611..000000000 --- a/test/EndToEnd/PHPUnit10/TestMethod/WithMaximumDurationAttribute/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With test methods with @maximumDuration Attributes ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -.. 2 / 2 (100%) - -Detected 1 test where the duration exceeded a custom or the global maximum duration (0.100). - -# Duration Test - Actual Maximum ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestMethod\WithMaximumDurationAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromAttributeWhenTestMethodHasValidMaximumDurationAttribute ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestMethod/WithRunInSeparateProcessAnnotation/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestMethod/WithRunInSeparateProcessAnnotation/SleeperTest.php deleted file mode 100644 index bba4dd7a8..000000000 --- a/test/EndToEnd/PHPUnit10/TestMethod/WithRunInSeparateProcessAnnotation/SleeperTest.php +++ /dev/null @@ -1,157 +0,0 @@ -sleep(); - } - - public static function tearDownAfterClass(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function setUp(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPreConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPostConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function tearDown(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @before - */ - public function sleepWithBeforeAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\Before] - public function sleepWithBeforeAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @after - */ - public function sleepWithAfterAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\After] - public function sleepWithAfterAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @beforeClass - */ - public function sleepWithBeforeClassAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\BeforeClass] - public function sleepWithBeforeClassAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @afterClass - */ - public function sleepWithAfterClassAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\AfterClass] - public function sleepWithAfterClassAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @runInSeparateProcess - */ - public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation(): void - { - $milliseconds = 50; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @runInSeparateProcess - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit10/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit10/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestMethod/WithRunInSeparateProcessAnnotation/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt b/test/EndToEnd/PHPUnit10/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt deleted file mode 100644 index 92826a060..000000000 --- a/test/EndToEnd/PHPUnit10/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -With a test case that sleeps in data provider, hook, and test methods and has test methods with @runInSeparateProcess annotation ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -.... 4 / 4 (100%) - -Detected 4 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestMethod\WithRunInSeparateProcessAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation -2 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestMethod\WithRunInSeparateProcessAnnotation\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation -3 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestMethod\WithRunInSeparateProcessAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration -4 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestMethod\WithRunInSeparateProcessAnnotation\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php deleted file mode 100644 index 7c7d124d0..000000000 --- a/test/EndToEnd/PHPUnit10/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php +++ /dev/null @@ -1,153 +0,0 @@ -sleep(); - } - - public static function tearDownAfterClass(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function setUp(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPreConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPostConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function tearDown(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @before - */ - public function sleepWithBeforeAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\Before] - public function sleepWithBeforeAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @beforeClass - */ - public function sleepWithBeforeClassAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\BeforeClass] - public function sleepWithBeforeClassAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @after - */ - public function sleepWithAfterAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\After] - public function sleepWithAfterAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - /** - * @afterClass - */ - public function sleepWithAfterClassAnnotation(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\AfterClass] - public function sleepWithAfterClassAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\RunInSeparateProcess] - public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute(): void - { - $milliseconds = 50; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\RunInSeparateProcess] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit10/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml b/test/EndToEnd/PHPUnit10/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestMethod/WithRunInSeparateProcessAttribute/test.phpt b/test/EndToEnd/PHPUnit10/TestMethod/WithRunInSeparateProcessAttribute/test.phpt deleted file mode 100644 index 9afda2951..000000000 --- a/test/EndToEnd/PHPUnit10/TestMethod/WithRunInSeparateProcessAttribute/test.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -With a test case that sleeps in data provider, hook, and test methods and has test methods with RunInSeparateProcess attribute ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -.... 4 / 4 (100%) - -Detected 4 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute -2 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute -3 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration -4 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/SleeperTest.php deleted file mode 100644 index 3e7ea4f52..000000000 --- a/test/EndToEnd/PHPUnit10/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/SleeperTest.php +++ /dev/null @@ -1,53 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 400 - * - * @maximumDuration 200 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit10/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit10/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt b/test/EndToEnd/PHPUnit10/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt deleted file mode 100644 index 163151596..000000000 --- a/test/EndToEnd/PHPUnit10/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With @maximumDuration and @slowThreshold annotations ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -.. 2 / 2 (100%) - -Detected 1 test where the duration exceeded a custom or the global maximum duration (0.100). - -# Duration Test - Actual Maximum ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestMethod\WithSlowThresholdAndMaximumDurationAnnotations\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit10/TestMethod/WithSlowThresholdAnnotation/SleeperTest.php b/test/EndToEnd/PHPUnit10/TestMethod/WithSlowThresholdAnnotation/SleeperTest.php deleted file mode 100644 index 6ce5fba0a..000000000 --- a/test/EndToEnd/PHPUnit10/TestMethod/WithSlowThresholdAnnotation/SleeperTest.php +++ /dev/null @@ -1,85 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 3.14 - * - * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidSlowThresholdAnnotation(): void - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 200 - * - * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 - */ - public function testSleeperSleepsShorterThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 200 - * - * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 - */ - public function testSleeperSleepsLongerThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit10/TestMethod/WithSlowThresholdAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit10/TestMethod/WithSlowThresholdAnnotation/phpunit.xml deleted file mode 100644 index 702c6e9bd..000000000 --- a/test/EndToEnd/PHPUnit10/TestMethod/WithSlowThresholdAnnotation/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit10/TestMethod/WithSlowThresholdAnnotation/test.phpt b/test/EndToEnd/PHPUnit10/TestMethod/WithSlowThresholdAnnotation/test.phpt deleted file mode 100644 index 6a499fffa..000000000 --- a/test/EndToEnd/PHPUnit10/TestMethod/WithSlowThresholdAnnotation/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With test methods with @slowThreshold annotations ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -.... 4 / 4 (100%) - -Detected 2 tests where the duration exceeded a custom or the global maximum duration (0.100). - -# Duration Test - Actual Maximum ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestMethod\WithSlowThresholdAnnotation\SleeperTest::testSleeperSleepsLongerThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit10\TestMethod\WithSlowThresholdAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidSlowThresholdAnnotation ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/Configuration/Defaults/SleeperTest.php b/test/EndToEnd/PHPUnit11/Configuration/Defaults/SleeperTest.php deleted file mode 100644 index d7e0dc0e6..000000000 --- a/test/EndToEnd/PHPUnit11/Configuration/Defaults/SleeperTest.php +++ /dev/null @@ -1,60 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] - public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable - { - $values = \range( - 600, - 1600, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit11/Configuration/Defaults/phpunit.xml b/test/EndToEnd/PHPUnit11/Configuration/Defaults/phpunit.xml deleted file mode 100644 index 14fbb245a..000000000 --- a/test/EndToEnd/PHPUnit11/Configuration/Defaults/phpunit.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/Configuration/Defaults/test.phpt b/test/EndToEnd/PHPUnit11/Configuration/Defaults/test.phpt deleted file mode 100644 index fc55a4e22..000000000 --- a/test/EndToEnd/PHPUnit11/Configuration/Defaults/test.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -With default configuration ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -............ 12 / 12 (100%) - -Detected 11 tests where the duration exceeded the global maximum duration (0.500). - - # Duration Test ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 1 1.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #10 (1600) - 2 1.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #9 (1500) - 3 1.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #8 (1400) - 4 1.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #7 (1300) - 5 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #6 (1200) - 6 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #5 (1100) - 7 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #4 (1000) - 8 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #3 (900) - 9 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #2 (800) -10 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #1 (700) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -There is 1 additional slow test that is not listed here. - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/Configuration/MaximumCount/SleeperTest.php b/test/EndToEnd/PHPUnit11/Configuration/MaximumCount/SleeperTest.php deleted file mode 100644 index 6ff740842..000000000 --- a/test/EndToEnd/PHPUnit11/Configuration/MaximumCount/SleeperTest.php +++ /dev/null @@ -1,60 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] - public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable - { - $values = \range( - 600, - 1000, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit11/Configuration/MaximumCount/phpunit.xml b/test/EndToEnd/PHPUnit11/Configuration/MaximumCount/phpunit.xml deleted file mode 100644 index 06dda0686..000000000 --- a/test/EndToEnd/PHPUnit11/Configuration/MaximumCount/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/Configuration/MaximumCount/test.phpt b/test/EndToEnd/PHPUnit11/Configuration/MaximumCount/test.phpt deleted file mode 100644 index a33b7284d..000000000 --- a/test/EndToEnd/PHPUnit11/Configuration/MaximumCount/test.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -With custom configuration setting the "maximum-count" parameter in the XML configuration file ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -...... 6 / 6 (100%) - -Detected 5 tests where the duration exceeded the global maximum duration (0.500). - -# Duration Test ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #4 (1000) -2 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #3 (900) -3 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #2 (800) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -There are 2 additional slow tests that are not listed here. - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/Configuration/MaximumDuration/SleeperTest.php b/test/EndToEnd/PHPUnit11/Configuration/MaximumDuration/SleeperTest.php deleted file mode 100644 index 1c942c733..000000000 --- a/test/EndToEnd/PHPUnit11/Configuration/MaximumDuration/SleeperTest.php +++ /dev/null @@ -1,60 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 1200, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit11/Configuration/MaximumDuration/phpunit.xml b/test/EndToEnd/PHPUnit11/Configuration/MaximumDuration/phpunit.xml deleted file mode 100644 index 49a1291f7..000000000 --- a/test/EndToEnd/PHPUnit11/Configuration/MaximumDuration/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/Configuration/MaximumDuration/test.phpt b/test/EndToEnd/PHPUnit11/Configuration/MaximumDuration/test.phpt deleted file mode 100644 index 487f38143..000000000 --- a/test/EndToEnd/PHPUnit11/Configuration/MaximumDuration/test.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -With custom configuration setting the "maximum-duration" parameter in the XML configuration file ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -............ 12 / 12 (100%) - -Detected 11 tests where the duration exceeded the global maximum duration (0.100). - - # Duration Test ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 1 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #10 (1200) - 2 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #9 (1100) - 3 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #8 (1000) - 4 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #7 (900) - 5 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #6 (800) - 6 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #5 (700) - 7 0.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #4 (600) - 8 0.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #3 (500) - 9 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #2 (400) -10 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -There is 1 additional slow test that is not listed here. - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/Configuration/Stderr/SleeperTest.php b/test/EndToEnd/PHPUnit11/Configuration/Stderr/SleeperTest.php deleted file mode 100644 index ef789ab9b..000000000 --- a/test/EndToEnd/PHPUnit11/Configuration/Stderr/SleeperTest.php +++ /dev/null @@ -1,60 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] - public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable - { - $values = \range( - 600, - 1600, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit11/Configuration/Stderr/phpunit.xml b/test/EndToEnd/PHPUnit11/Configuration/Stderr/phpunit.xml deleted file mode 100644 index 1041df416..000000000 --- a/test/EndToEnd/PHPUnit11/Configuration/Stderr/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/Configuration/Stderr/test.phpt b/test/EndToEnd/PHPUnit11/Configuration/Stderr/test.phpt deleted file mode 100644 index ea2a57a2c..000000000 --- a/test/EndToEnd/PHPUnit11/Configuration/Stderr/test.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -With configuration setting stderr to true ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -............ 12 / 12 (100%) - -Detected 11 tests where the duration exceeded the global maximum duration (0.500). - - # Duration Test --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 1 1.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #10 (1600) - 2 1.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #9 (1500) - 3 1.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #8 (1400) - 4 1.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #7 (1300) - 5 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #6 (1200) - 6 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #5 (1100) - 7 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #4 (1000) - 8 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #3 (900) - 9 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #2 (800) -10 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #1 (700) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -There is 1 additional slow test that is not listed here. - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/Console/Configuration/Defaults/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/Configuration/Defaults/SleeperTest.php new file mode 100644 index 000000000..bbf482179 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/Configuration/Defaults/SleeperTest.php @@ -0,0 +1,60 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] + public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable + { + $values = \range( + 600, + 1600, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/Configuration/Defaults/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/Configuration/Defaults/phpunit.xml new file mode 100644 index 000000000..5ec4e0eea --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/Configuration/Defaults/phpunit.xml @@ -0,0 +1,32 @@ + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/Configuration/Defaults/test.phpt b/test/EndToEnd/PHPUnit11/Console/Configuration/Defaults/test.phpt new file mode 100644 index 000000000..150e56529 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/Configuration/Defaults/test.phpt @@ -0,0 +1,43 @@ +--TEST-- +With default configuration +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +............ 12 / 12 (100%) + +Detected 11 tests where the duration exceeded the global maximum duration (0.500). + + # Duration Test +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 1 1.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #10 (1600) + 2 1.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #9 (1500) + 3 1.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #8 (1400) + 4 1.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #7 (1300) + 5 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #6 (1200) + 6 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #5 (1100) + 7 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #4 (1000) + 8 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #3 (900) + 9 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #2 (800) +10 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #1 (700) +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 0.000 + └─── seconds + +There is 1 additional slow test that is not listed here. + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/Configuration/MaximumCount/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/Configuration/MaximumCount/SleeperTest.php new file mode 100644 index 000000000..97aea4826 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/Configuration/MaximumCount/SleeperTest.php @@ -0,0 +1,60 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] + public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable + { + $values = \range( + 600, + 1000, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/Configuration/MaximumCount/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/Configuration/MaximumCount/phpunit.xml new file mode 100644 index 000000000..60f030eff --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/Configuration/MaximumCount/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/Configuration/MaximumCount/test.phpt b/test/EndToEnd/PHPUnit11/Console/Configuration/MaximumCount/test.phpt new file mode 100644 index 000000000..cc09bd482 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/Configuration/MaximumCount/test.phpt @@ -0,0 +1,36 @@ +--TEST-- +With custom configuration setting the "maximum-count" parameter in the XML configuration file +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +...... 6 / 6 (100%) + +Detected 5 tests where the duration exceeded the global maximum duration (0.500). + +# Duration Test +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #4 (1000) +2 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #3 (900) +3 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #2 (800) +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +There are 2 additional slow tests that are not listed here. + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/Configuration/MaximumDuration/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/Configuration/MaximumDuration/SleeperTest.php new file mode 100644 index 000000000..6c63d470e --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/Configuration/MaximumDuration/SleeperTest.php @@ -0,0 +1,60 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 1200, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/Configuration/MaximumDuration/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/Configuration/MaximumDuration/phpunit.xml new file mode 100644 index 000000000..b061b0ee7 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/Configuration/MaximumDuration/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/Configuration/MaximumDuration/test.phpt b/test/EndToEnd/PHPUnit11/Console/Configuration/MaximumDuration/test.phpt new file mode 100644 index 000000000..aeed9d5e1 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/Configuration/MaximumDuration/test.phpt @@ -0,0 +1,43 @@ +--TEST-- +With custom configuration setting the "maximum-duration" parameter in the XML configuration file +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +............ 12 / 12 (100%) + +Detected 11 tests where the duration exceeded the global maximum duration (0.100). + + # Duration Test +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 1 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #10 (1200) + 2 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #9 (1100) + 3 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #8 (1000) + 4 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #7 (900) + 5 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #6 (800) + 6 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #5 (700) + 7 0.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #4 (600) + 8 0.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #3 (500) + 9 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #2 (400) +10 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +There is 1 additional slow test that is not listed here. + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/Configuration/Stderr/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/Configuration/Stderr/SleeperTest.php new file mode 100644 index 000000000..c5ad0c2e9 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/Configuration/Stderr/SleeperTest.php @@ -0,0 +1,60 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] + public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable + { + $values = \range( + 600, + 1600, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/Configuration/Stderr/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/Configuration/Stderr/phpunit.xml new file mode 100644 index 000000000..c20c78c78 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/Configuration/Stderr/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/Configuration/Stderr/test.phpt b/test/EndToEnd/PHPUnit11/Console/Configuration/Stderr/test.phpt new file mode 100644 index 000000000..acd77d2d5 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/Configuration/Stderr/test.phpt @@ -0,0 +1,43 @@ +--TEST-- +With configuration setting stderr to true +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +............ 12 / 12 (100%) + +Detected 11 tests where the duration exceeded the global maximum duration (0.500). + + # Duration Test +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 1 1.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #10 (1600) + 2 1.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #9 (1500) + 3 1.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #8 (1400) + 4 1.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #7 (1300) + 5 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #6 (1200) + 6 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #5 (1100) + 7 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #4 (1000) + 8 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #3 (900) + 9 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #2 (800) +10 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider with data set #1 (700) +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +There is 1 additional slow test that is not listed here. + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/Option/NoOutput/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/Option/NoOutput/SleeperTest.php new file mode 100644 index 000000000..91ddabe32 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/Option/NoOutput/SleeperTest.php @@ -0,0 +1,32 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/Option/NoOutput/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/Option/NoOutput/phpunit.xml new file mode 100644 index 000000000..fb4524784 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/Option/NoOutput/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/Option/NoOutput/test.phpt b/test/EndToEnd/PHPUnit11/Console/Option/NoOutput/test.phpt new file mode 100644 index 000000000..899fac8ce --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/Option/NoOutput/test.phpt @@ -0,0 +1,18 @@ +--TEST-- +With default configuration of extension +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/Bare/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/TestCase/Bare/SleeperTest.php new file mode 100644 index 000000000..7a52ddc86 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/Bare/SleeperTest.php @@ -0,0 +1,60 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/Bare/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/TestCase/Bare/phpunit.xml new file mode 100644 index 000000000..fb4524784 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/Bare/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/Bare/test.phpt b/test/EndToEnd/PHPUnit11/Console/TestCase/Bare/test.phpt new file mode 100644 index 000000000..10ba6fedd --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/Bare/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that does not sleep in methods that are not test methods +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\Bare\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\Bare\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/Combination/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/TestCase/Combination/SleeperTest.php new file mode 100644 index 000000000..7b9795ab1 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/Combination/SleeperTest.php @@ -0,0 +1,116 @@ +sleep(); + } + + public static function tearDownAfterClass(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function setUp(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPreConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPostConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function tearDown(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\Before] + public function sleepWithBeforeAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\BeforeClass] + public static function sleepWithBeforeClassAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\After] + public function sleepWithAfterAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\AfterClass] + public static function sleepWithAfterClassAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/Combination/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/TestCase/Combination/phpunit.xml new file mode 100644 index 000000000..fb4524784 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/Combination/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/Combination/test.phpt b/test/EndToEnd/PHPUnit11/Console/TestCase/Combination/test.phpt new file mode 100644 index 000000000..7e2de25a1 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/Combination/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in data provider, hook, and test methods +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\Combination\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\Combination\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +3 0.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\Combination\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithAfterAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAfterAttribute/SleeperTest.php new file mode 100644 index 000000000..d3b2b27e0 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAfterAttribute/SleeperTest.php @@ -0,0 +1,66 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithAfterAttribute/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAfterAttribute/phpunit.xml new file mode 100644 index 000000000..fb4524784 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAfterAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithAfterAttribute/test.phpt b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAfterAttribute/test.phpt new file mode 100644 index 000000000..5505d7804 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAfterAttribute/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in a method with After attribute +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithAfterClassAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAfterClassAttribute/SleeperTest.php new file mode 100644 index 000000000..3612a6219 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAfterClassAttribute/SleeperTest.php @@ -0,0 +1,66 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithAfterClassAttribute/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAfterClassAttribute/phpunit.xml new file mode 100644 index 000000000..fb4524784 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAfterClassAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithAfterClassAttribute/test.phpt b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAfterClassAttribute/test.phpt new file mode 100644 index 000000000..09e5985d3 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAfterClassAttribute/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a method with AfterClass attribute +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithAfterClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithAfterClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithAssertPostConditions/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAssertPostConditions/SleeperTest.php new file mode 100644 index 000000000..3b0690fee --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAssertPostConditions/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithAssertPostConditions/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAssertPostConditions/phpunit.xml new file mode 100644 index 000000000..fb4524784 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAssertPostConditions/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithAssertPostConditions/test.phpt b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAssertPostConditions/test.phpt new file mode 100644 index 000000000..96d23c11b --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAssertPostConditions/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in assertPostConditions() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithAssertPreConditions/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAssertPreConditions/SleeperTest.php new file mode 100644 index 000000000..813560ed7 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAssertPreConditions/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithAssertPreConditions/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAssertPreConditions/phpunit.xml new file mode 100644 index 000000000..fb4524784 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAssertPreConditions/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithAssertPreConditions/test.phpt b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAssertPreConditions/test.phpt new file mode 100644 index 000000000..d1da5c015 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithAssertPreConditions/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in assertPreConditions() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithBeforeAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/TestCase/WithBeforeAttribute/SleeperTest.php new file mode 100644 index 000000000..b5262e42f --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithBeforeAttribute/SleeperTest.php @@ -0,0 +1,66 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithBeforeAttribute/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/TestCase/WithBeforeAttribute/phpunit.xml new file mode 100644 index 000000000..fb4524784 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithBeforeAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithBeforeAttribute/test.phpt b/test/EndToEnd/PHPUnit11/Console/TestCase/WithBeforeAttribute/test.phpt new file mode 100644 index 000000000..732780ad2 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithBeforeAttribute/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in a method with Before attribute +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithBeforeClassAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/TestCase/WithBeforeClassAttribute/SleeperTest.php new file mode 100644 index 000000000..f24ec1006 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithBeforeClassAttribute/SleeperTest.php @@ -0,0 +1,66 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithBeforeClassAttribute/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/TestCase/WithBeforeClassAttribute/phpunit.xml new file mode 100644 index 000000000..fb4524784 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithBeforeClassAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithBeforeClassAttribute/test.phpt b/test/EndToEnd/PHPUnit11/Console/TestCase/WithBeforeClassAttribute/test.phpt new file mode 100644 index 000000000..62558ae44 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithBeforeClassAttribute/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a method with BeforeClass attribute +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithBeforeClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithBeforeClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithDataProvider/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/TestCase/WithDataProvider/SleeperTest.php new file mode 100644 index 000000000..b39b49655 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithDataProvider/SleeperTest.php @@ -0,0 +1,62 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithDataProvider/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/TestCase/WithDataProvider/phpunit.xml new file mode 100644 index 000000000..fb4524784 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithDataProvider/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithDataProvider/test.phpt b/test/EndToEnd/PHPUnit11/Console/TestCase/WithDataProvider/test.phpt new file mode 100644 index 000000000..bf10aa520 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithDataProvider/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a data provider +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithDataProvider\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithDataProvider\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithSetUp/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/TestCase/WithSetUp/SleeperTest.php new file mode 100644 index 000000000..1ac31c29d --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithSetUp/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithSetUp/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/TestCase/WithSetUp/phpunit.xml new file mode 100644 index 000000000..fb4524784 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithSetUp/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithSetUp/test.phpt b/test/EndToEnd/PHPUnit11/Console/TestCase/WithSetUp/test.phpt new file mode 100644 index 000000000..6622af659 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithSetUp/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in a setUp() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithSetUpBeforeClass/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/TestCase/WithSetUpBeforeClass/SleeperTest.php new file mode 100644 index 000000000..10933d094 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithSetUpBeforeClass/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithSetUpBeforeClass/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/TestCase/WithSetUpBeforeClass/phpunit.xml new file mode 100644 index 000000000..fb4524784 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithSetUpBeforeClass/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithSetUpBeforeClass/test.phpt b/test/EndToEnd/PHPUnit11/Console/TestCase/WithSetUpBeforeClass/test.phpt new file mode 100644 index 000000000..79a04d458 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithSetUpBeforeClass/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a setUpBeforeClass() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithSetUpBeforeClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithSetUpBeforeClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithTearDown/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/TestCase/WithTearDown/SleeperTest.php new file mode 100644 index 000000000..61e3974b2 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithTearDown/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithTearDown/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/TestCase/WithTearDown/phpunit.xml new file mode 100644 index 000000000..fb4524784 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithTearDown/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithTearDown/test.phpt b/test/EndToEnd/PHPUnit11/Console/TestCase/WithTearDown/test.phpt new file mode 100644 index 000000000..90ea79d70 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithTearDown/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in a tearDown() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithTearDownAfterClass/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/TestCase/WithTearDownAfterClass/SleeperTest.php new file mode 100644 index 000000000..bc43f5d7f --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithTearDownAfterClass/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithTearDownAfterClass/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/TestCase/WithTearDownAfterClass/phpunit.xml new file mode 100644 index 000000000..fb4524784 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithTearDownAfterClass/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithTearDownAfterClass/test.phpt b/test/EndToEnd/PHPUnit11/Console/TestCase/WithTearDownAfterClass/test.phpt new file mode 100644 index 000000000..b874ad22a --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithTearDownAfterClass/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a tearDownAfterClass() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithTearDownAfterClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithTearDownAfterClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithoutTestMethods/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/TestCase/WithoutTestMethods/SleeperTest.php new file mode 100644 index 000000000..627f27f7c --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithoutTestMethods/SleeperTest.php @@ -0,0 +1,23 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/TestCase/WithoutTestMethods/test.phpt b/test/EndToEnd/PHPUnit11/Console/TestCase/WithoutTestMethods/test.phpt new file mode 100644 index 000000000..d49e50932 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestCase/WithoutTestMethods/test.phpt @@ -0,0 +1,24 @@ +--TEST-- +With a test case that has no test methods +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +There was 1 PHPUnit test runner warning: + +1) No tests found in class "Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestCase\WithoutTestMethods\SleeperTest". + +No tests executed! diff --git a/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/SleeperTest.php new file mode 100644 index 000000000..bb9b21e01 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/SleeperTest.php @@ -0,0 +1,53 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @maximumDuration 200 + * + * @slowThreshold 400 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml new file mode 100644 index 000000000..fb4524784 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt new file mode 100644 index 000000000..766453a8c --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With @maximumDuration and @slowThreshold annotations +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +.. 2 / 2 (100%) + +Detected 1 test where the duration exceeded a custom or the global maximum duration (0.100). + +# Duration Test + Actual Maximum +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestMethod\WithMaximumDurationAndSlowThresholdAnnotations\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAnnotation/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAnnotation/SleeperTest.php new file mode 100644 index 000000000..4c4be7b57 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAnnotation/SleeperTest.php @@ -0,0 +1,133 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @maximumDuration 3.14 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidMaximumDurationAnnotation(): void + { + $milliseconds = 200; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @maximumDuration 200 + */ + public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @dataProvider provideDataWhereDataNameIsInteger + * + * @maximumDuration 200 + */ + public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNumericDataProvider(): void + { + $milliseconds = 150; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return list + */ + public static function provideDataWhereDataNameIsInteger(): array + { + return [ + [ + 'bar', + ], + ]; + } + + /** + * @dataProvider provideDataWhereDataNameIsString + * + * @maximumDuration 200 + */ + public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNamedDataProvider(): void + { + $milliseconds = 150; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return array + */ + public static function provideDataWhereDataNameIsString(): array + { + return [ + 'foo' => [ + 'bar', + ], + ]; + } + + /** + * @maximumDuration 200 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAnnotation/phpunit.xml new file mode 100644 index 000000000..fb4524784 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAnnotation/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAnnotation/test.phpt b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAnnotation/test.phpt new file mode 100644 index 000000000..52b141d50 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAnnotation/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With test methods with @maximumDuration annotations +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +...... 6 / 6 (100%) + +Detected 2 tests where the duration exceeded a custom or the global maximum duration (0.100). + +# Duration Test + Actual Maximum +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestMethod\WithMaximumDurationAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestMethod\WithMaximumDurationAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidMaximumDurationAnnotation +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAttribute/SleeperTest.php new file mode 100644 index 000000000..0e5d5fd9d --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAttribute/SleeperTest.php @@ -0,0 +1,46 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Attribute\MaximumDuration(200)] + public function testSleeperSleepsLongerThanMaximumDurationFromAttributeWhenTestMethodHasValidMaximumDurationAttribute(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAttribute/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAttribute/phpunit.xml new file mode 100644 index 000000000..fb4524784 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAttribute/test.phpt b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAttribute/test.phpt new file mode 100644 index 000000000..448842c79 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithMaximumDurationAttribute/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With test methods with @maximumDuration Attributes +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +.. 2 / 2 (100%) + +Detected 1 test where the duration exceeded a custom or the global maximum duration (0.100). + +# Duration Test + Actual Maximum +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestMethod\WithMaximumDurationAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromAttributeWhenTestMethodHasValidMaximumDurationAttribute +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php new file mode 100644 index 000000000..359f90053 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php @@ -0,0 +1,121 @@ +sleep(); + } + + public static function tearDownAfterClass(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function setUp(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPreConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPostConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function tearDown(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\Before] + public function sleepWithBeforeAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\BeforeClass] + public static function sleepWithBeforeClassAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\After] + public function sleepWithAfterAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\AfterClass] + public static function sleepWithAfterClassAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 50; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\RunInSeparateProcess] + public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 200; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\RunInSeparateProcess] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml new file mode 100644 index 000000000..fb4524784 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/TestMethod/WithRunInSeparateProcessAttribute/test.phpt b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithRunInSeparateProcessAttribute/test.phpt new file mode 100644 index 000000000..9b12c1a09 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithRunInSeparateProcessAttribute/test.phpt @@ -0,0 +1,40 @@ +--TEST-- +With a test case that sleeps in data provider, hook, and test methods and has test methods with RunInSeparateProcess attribute +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +.... 4 / 4 (100%) + +Detected 4 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +1 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute +2 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute +3 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration +4 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/SleeperTest.php new file mode 100644 index 000000000..adad336bd --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/SleeperTest.php @@ -0,0 +1,53 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 400 + * + * @maximumDuration 200 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml new file mode 100644 index 000000000..fb4524784 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt new file mode 100644 index 000000000..3737f398f --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With @maximumDuration and @slowThreshold annotations +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +.. 2 / 2 (100%) + +Detected 1 test where the duration exceeded a custom or the global maximum duration (0.100). + +# Duration Test + Actual Maximum +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestMethod\WithSlowThresholdAndMaximumDurationAnnotations\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Console/TestMethod/WithSlowThresholdAnnotation/SleeperTest.php b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithSlowThresholdAnnotation/SleeperTest.php new file mode 100644 index 000000000..cae5a5229 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithSlowThresholdAnnotation/SleeperTest.php @@ -0,0 +1,85 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 3.14 + * + * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 + */ + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidSlowThresholdAnnotation(): void + { + $milliseconds = 200; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 200 + * + * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 + */ + public function testSleeperSleepsShorterThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @slowThreshold 200 + * + * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 + */ + public function testSleeperSleepsLongerThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit11/Console/TestMethod/WithSlowThresholdAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithSlowThresholdAnnotation/phpunit.xml new file mode 100644 index 000000000..fb4524784 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithSlowThresholdAnnotation/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit11/Console/TestMethod/WithSlowThresholdAnnotation/test.phpt b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithSlowThresholdAnnotation/test.phpt new file mode 100644 index 000000000..5b6b23474 --- /dev/null +++ b/test/EndToEnd/PHPUnit11/Console/TestMethod/WithSlowThresholdAnnotation/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With test methods with @slowThreshold annotations +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +.... 4 / 4 (100%) + +Detected 2 tests where the duration exceeded a custom or the global maximum duration (0.100). + +# Duration Test + Actual Maximum +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestMethod\WithSlowThresholdAnnotation\SleeperTest::testSleeperSleepsLongerThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\Console\TestMethod\WithSlowThresholdAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidSlowThresholdAnnotation +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit11/Option/NoOutput/SleeperTest.php b/test/EndToEnd/PHPUnit11/Option/NoOutput/SleeperTest.php deleted file mode 100644 index 1e328c385..000000000 --- a/test/EndToEnd/PHPUnit11/Option/NoOutput/SleeperTest.php +++ /dev/null @@ -1,32 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit11/Option/NoOutput/phpunit.xml b/test/EndToEnd/PHPUnit11/Option/NoOutput/phpunit.xml deleted file mode 100644 index fb1f0d84f..000000000 --- a/test/EndToEnd/PHPUnit11/Option/NoOutput/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/Option/NoOutput/test.phpt b/test/EndToEnd/PHPUnit11/Option/NoOutput/test.phpt deleted file mode 100644 index 81e7de23f..000000000 --- a/test/EndToEnd/PHPUnit11/Option/NoOutput/test.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -With default configuration of extension ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- diff --git a/test/EndToEnd/PHPUnit11/TestCase/Bare/SleeperTest.php b/test/EndToEnd/PHPUnit11/TestCase/Bare/SleeperTest.php deleted file mode 100644 index 5611cf016..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/Bare/SleeperTest.php +++ /dev/null @@ -1,60 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit11/TestCase/Bare/phpunit.xml b/test/EndToEnd/PHPUnit11/TestCase/Bare/phpunit.xml deleted file mode 100644 index fb1f0d84f..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/Bare/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/TestCase/Bare/test.phpt b/test/EndToEnd/PHPUnit11/TestCase/Bare/test.phpt deleted file mode 100644 index 52d266945..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/Bare/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that does not sleep in methods that are not test methods ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\Bare\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\Bare\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/TestCase/Combination/SleeperTest.php b/test/EndToEnd/PHPUnit11/TestCase/Combination/SleeperTest.php deleted file mode 100644 index 58e5ca5c1..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/Combination/SleeperTest.php +++ /dev/null @@ -1,116 +0,0 @@ -sleep(); - } - - public static function tearDownAfterClass(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function setUp(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPreConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPostConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function tearDown(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\Before] - public function sleepWithBeforeAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\BeforeClass] - public static function sleepWithBeforeClassAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\After] - public function sleepWithAfterAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\AfterClass] - public static function sleepWithAfterClassAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit11/TestCase/Combination/phpunit.xml b/test/EndToEnd/PHPUnit11/TestCase/Combination/phpunit.xml deleted file mode 100644 index fb1f0d84f..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/Combination/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/TestCase/Combination/test.phpt b/test/EndToEnd/PHPUnit11/TestCase/Combination/test.phpt deleted file mode 100644 index 8df13dafd..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/Combination/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in data provider, hook, and test methods ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\Combination\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\Combination\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) -3 0.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\Combination\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithAfterAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit11/TestCase/WithAfterAttribute/SleeperTest.php deleted file mode 100644 index 2a06133e7..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithAfterAttribute/SleeperTest.php +++ /dev/null @@ -1,66 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithAfterAttribute/phpunit.xml b/test/EndToEnd/PHPUnit11/TestCase/WithAfterAttribute/phpunit.xml deleted file mode 100644 index fb1f0d84f..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithAfterAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithAfterAttribute/test.phpt b/test/EndToEnd/PHPUnit11/TestCase/WithAfterAttribute/test.phpt deleted file mode 100644 index bda51013b..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithAfterAttribute/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with After attribute ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithAfterClassAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit11/TestCase/WithAfterClassAttribute/SleeperTest.php deleted file mode 100644 index a10045af8..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithAfterClassAttribute/SleeperTest.php +++ /dev/null @@ -1,66 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithAfterClassAttribute/phpunit.xml b/test/EndToEnd/PHPUnit11/TestCase/WithAfterClassAttribute/phpunit.xml deleted file mode 100644 index fb1f0d84f..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithAfterClassAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithAfterClassAttribute/test.phpt b/test/EndToEnd/PHPUnit11/TestCase/WithAfterClassAttribute/test.phpt deleted file mode 100644 index a276b8828..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithAfterClassAttribute/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with AfterClass attribute ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithAfterClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithAfterClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithAssertPostConditions/SleeperTest.php b/test/EndToEnd/PHPUnit11/TestCase/WithAssertPostConditions/SleeperTest.php deleted file mode 100644 index f26e99d28..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithAssertPostConditions/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithAssertPostConditions/phpunit.xml b/test/EndToEnd/PHPUnit11/TestCase/WithAssertPostConditions/phpunit.xml deleted file mode 100644 index fb1f0d84f..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithAssertPostConditions/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithAssertPostConditions/test.phpt b/test/EndToEnd/PHPUnit11/TestCase/WithAssertPostConditions/test.phpt deleted file mode 100644 index 4f4a32bb1..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithAssertPostConditions/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in assertPostConditions() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithAssertPreConditions/SleeperTest.php b/test/EndToEnd/PHPUnit11/TestCase/WithAssertPreConditions/SleeperTest.php deleted file mode 100644 index a851490a7..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithAssertPreConditions/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithAssertPreConditions/phpunit.xml b/test/EndToEnd/PHPUnit11/TestCase/WithAssertPreConditions/phpunit.xml deleted file mode 100644 index fb1f0d84f..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithAssertPreConditions/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithAssertPreConditions/test.phpt b/test/EndToEnd/PHPUnit11/TestCase/WithAssertPreConditions/test.phpt deleted file mode 100644 index 5e5a1a7a9..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithAssertPreConditions/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in assertPreConditions() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithBeforeAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit11/TestCase/WithBeforeAttribute/SleeperTest.php deleted file mode 100644 index d66a3c011..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithBeforeAttribute/SleeperTest.php +++ /dev/null @@ -1,66 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithBeforeAttribute/phpunit.xml b/test/EndToEnd/PHPUnit11/TestCase/WithBeforeAttribute/phpunit.xml deleted file mode 100644 index fb1f0d84f..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithBeforeAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithBeforeAttribute/test.phpt b/test/EndToEnd/PHPUnit11/TestCase/WithBeforeAttribute/test.phpt deleted file mode 100644 index 537c89089..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithBeforeAttribute/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with Before attribute ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithBeforeClassAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit11/TestCase/WithBeforeClassAttribute/SleeperTest.php deleted file mode 100644 index 0c7476f04..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithBeforeClassAttribute/SleeperTest.php +++ /dev/null @@ -1,66 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithBeforeClassAttribute/phpunit.xml b/test/EndToEnd/PHPUnit11/TestCase/WithBeforeClassAttribute/phpunit.xml deleted file mode 100644 index fb1f0d84f..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithBeforeClassAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithBeforeClassAttribute/test.phpt b/test/EndToEnd/PHPUnit11/TestCase/WithBeforeClassAttribute/test.phpt deleted file mode 100644 index 93774156d..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithBeforeClassAttribute/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with BeforeClass attribute ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithBeforeClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithBeforeClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithDataProvider/SleeperTest.php b/test/EndToEnd/PHPUnit11/TestCase/WithDataProvider/SleeperTest.php deleted file mode 100644 index e45f596f4..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithDataProvider/SleeperTest.php +++ /dev/null @@ -1,62 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithDataProvider/phpunit.xml b/test/EndToEnd/PHPUnit11/TestCase/WithDataProvider/phpunit.xml deleted file mode 100644 index fb1f0d84f..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithDataProvider/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithDataProvider/test.phpt b/test/EndToEnd/PHPUnit11/TestCase/WithDataProvider/test.phpt deleted file mode 100644 index 5538a5a05..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithDataProvider/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a data provider ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithDataProvider\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithDataProvider\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithSetUp/SleeperTest.php b/test/EndToEnd/PHPUnit11/TestCase/WithSetUp/SleeperTest.php deleted file mode 100644 index cc5e40b53..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithSetUp/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithSetUp/phpunit.xml b/test/EndToEnd/PHPUnit11/TestCase/WithSetUp/phpunit.xml deleted file mode 100644 index fb1f0d84f..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithSetUp/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithSetUp/test.phpt b/test/EndToEnd/PHPUnit11/TestCase/WithSetUp/test.phpt deleted file mode 100644 index 3300ab75c..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithSetUp/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in a setUp() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithSetUpBeforeClass/SleeperTest.php b/test/EndToEnd/PHPUnit11/TestCase/WithSetUpBeforeClass/SleeperTest.php deleted file mode 100644 index 718228ac6..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithSetUpBeforeClass/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithSetUpBeforeClass/phpunit.xml b/test/EndToEnd/PHPUnit11/TestCase/WithSetUpBeforeClass/phpunit.xml deleted file mode 100644 index fb1f0d84f..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithSetUpBeforeClass/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithSetUpBeforeClass/test.phpt b/test/EndToEnd/PHPUnit11/TestCase/WithSetUpBeforeClass/test.phpt deleted file mode 100644 index 86981cc80..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithSetUpBeforeClass/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a setUpBeforeClass() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithSetUpBeforeClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithSetUpBeforeClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithTearDown/SleeperTest.php b/test/EndToEnd/PHPUnit11/TestCase/WithTearDown/SleeperTest.php deleted file mode 100644 index 232c43651..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithTearDown/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithTearDown/phpunit.xml b/test/EndToEnd/PHPUnit11/TestCase/WithTearDown/phpunit.xml deleted file mode 100644 index fb1f0d84f..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithTearDown/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithTearDown/test.phpt b/test/EndToEnd/PHPUnit11/TestCase/WithTearDown/test.phpt deleted file mode 100644 index 990a2d3b0..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithTearDown/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in a tearDown() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithTearDownAfterClass/SleeperTest.php b/test/EndToEnd/PHPUnit11/TestCase/WithTearDownAfterClass/SleeperTest.php deleted file mode 100644 index 1e6202c24..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithTearDownAfterClass/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithTearDownAfterClass/phpunit.xml b/test/EndToEnd/PHPUnit11/TestCase/WithTearDownAfterClass/phpunit.xml deleted file mode 100644 index fb1f0d84f..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithTearDownAfterClass/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithTearDownAfterClass/test.phpt b/test/EndToEnd/PHPUnit11/TestCase/WithTearDownAfterClass/test.phpt deleted file mode 100644 index 1578046b6..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithTearDownAfterClass/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a tearDownAfterClass() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithTearDownAfterClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #1 (300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithTearDownAfterClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider with data set #0 (200) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithoutTestMethods/SleeperTest.php b/test/EndToEnd/PHPUnit11/TestCase/WithoutTestMethods/SleeperTest.php deleted file mode 100644 index e682c4ccc..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithoutTestMethods/SleeperTest.php +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/TestCase/WithoutTestMethods/test.phpt b/test/EndToEnd/PHPUnit11/TestCase/WithoutTestMethods/test.phpt deleted file mode 100644 index 282706479..000000000 --- a/test/EndToEnd/PHPUnit11/TestCase/WithoutTestMethods/test.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -With a test case that has no test methods ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -There was 1 PHPUnit test runner warning: - -1) No tests found in class "Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestCase\WithoutTestMethods\SleeperTest". - -No tests executed! diff --git a/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/SleeperTest.php b/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/SleeperTest.php deleted file mode 100644 index ac77e2227..000000000 --- a/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/SleeperTest.php +++ /dev/null @@ -1,53 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 200 - * - * @slowThreshold 400 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml deleted file mode 100644 index fb1f0d84f..000000000 --- a/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt b/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt deleted file mode 100644 index bdedad6dc..000000000 --- a/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAndSlowThresholdAnnotations/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With @maximumDuration and @slowThreshold annotations ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -.. 2 / 2 (100%) - -Detected 1 test where the duration exceeded a custom or the global maximum duration (0.100). - -# Duration Test - Actual Maximum ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestMethod\WithMaximumDurationAndSlowThresholdAnnotations\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAnnotation/SleeperTest.php b/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAnnotation/SleeperTest.php deleted file mode 100644 index f18ad6e3f..000000000 --- a/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAnnotation/SleeperTest.php +++ /dev/null @@ -1,133 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 3.14 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidMaximumDurationAnnotation(): void - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 200 - */ - public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @dataProvider provideDataWhereDataNameIsInteger - * - * @maximumDuration 200 - */ - public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNumericDataProvider(): void - { - $milliseconds = 150; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return list - */ - public static function provideDataWhereDataNameIsInteger(): array - { - return [ - [ - 'bar', - ], - ]; - } - - /** - * @dataProvider provideDataWhereDataNameIsString - * - * @maximumDuration 200 - */ - public function testSleeperSleepsShorterThanMaximumDurationFromAnnotationWithNamedDataProvider(): void - { - $milliseconds = 150; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return array - */ - public static function provideDataWhereDataNameIsString(): array - { - return [ - 'foo' => [ - 'bar', - ], - ]; - } - - /** - * @maximumDuration 200 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAnnotation/phpunit.xml deleted file mode 100644 index fb1f0d84f..000000000 --- a/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAnnotation/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAnnotation/test.phpt b/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAnnotation/test.phpt deleted file mode 100644 index 96e23149f..000000000 --- a/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAnnotation/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With test methods with @maximumDuration annotations ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -...... 6 / 6 (100%) - -Detected 2 tests where the duration exceeded a custom or the global maximum duration (0.100). - -# Duration Test - Actual Maximum ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestMethod\WithMaximumDurationAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasValidMaximumDurationAnnotation -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestMethod\WithMaximumDurationAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidMaximumDurationAnnotation ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAttribute/SleeperTest.php deleted file mode 100644 index 2cfdf9251..000000000 --- a/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAttribute/SleeperTest.php +++ /dev/null @@ -1,46 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Attribute\MaximumDuration(200)] - public function testSleeperSleepsLongerThanMaximumDurationFromAttributeWhenTestMethodHasValidMaximumDurationAttribute(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAttribute/phpunit.xml b/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAttribute/phpunit.xml deleted file mode 100644 index fb1f0d84f..000000000 --- a/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAttribute/test.phpt b/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAttribute/test.phpt deleted file mode 100644 index 372d8fd62..000000000 --- a/test/EndToEnd/PHPUnit11/TestMethod/WithMaximumDurationAttribute/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With test methods with @maximumDuration Attributes ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -.. 2 / 2 (100%) - -Detected 1 test where the duration exceeded a custom or the global maximum duration (0.100). - -# Duration Test - Actual Maximum ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestMethod\WithMaximumDurationAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromAttributeWhenTestMethodHasValidMaximumDurationAttribute ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit11/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php deleted file mode 100644 index 58eb78f01..000000000 --- a/test/EndToEnd/PHPUnit11/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php +++ /dev/null @@ -1,121 +0,0 @@ -sleep(); - } - - public static function tearDownAfterClass(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function setUp(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPreConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPostConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function tearDown(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\Before] - public function sleepWithBeforeAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\BeforeClass] - public static function sleepWithBeforeClassAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\After] - public function sleepWithAfterAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\AfterClass] - public static function sleepWithAfterClassAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 50; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\RunInSeparateProcess] - public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\RunInSeparateProcess] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit11/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml b/test/EndToEnd/PHPUnit11/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml deleted file mode 100644 index fb1f0d84f..000000000 --- a/test/EndToEnd/PHPUnit11/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/TestMethod/WithRunInSeparateProcessAttribute/test.phpt b/test/EndToEnd/PHPUnit11/TestMethod/WithRunInSeparateProcessAttribute/test.phpt deleted file mode 100644 index 43618f325..000000000 --- a/test/EndToEnd/PHPUnit11/TestMethod/WithRunInSeparateProcessAttribute/test.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -With a test case that sleeps in data provider, hook, and test methods and has test methods with RunInSeparateProcess attribute ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -.... 4 / 4 (100%) - -Detected 4 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute -2 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute -3 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration -4 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/SleeperTest.php b/test/EndToEnd/PHPUnit11/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/SleeperTest.php deleted file mode 100644 index aac2745a4..000000000 --- a/test/EndToEnd/PHPUnit11/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/SleeperTest.php +++ /dev/null @@ -1,53 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 400 - * - * @maximumDuration 200 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit11/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml b/test/EndToEnd/PHPUnit11/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml deleted file mode 100644 index fb1f0d84f..000000000 --- a/test/EndToEnd/PHPUnit11/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt b/test/EndToEnd/PHPUnit11/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt deleted file mode 100644 index cebe09fc6..000000000 --- a/test/EndToEnd/PHPUnit11/TestMethod/WithSlowThresholdAndMaximumDurationAnnotations/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With @maximumDuration and @slowThreshold annotations ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -.. 2 / 2 (100%) - -Detected 1 test where the duration exceeded a custom or the global maximum duration (0.100). - -# Duration Test - Actual Maximum ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestMethod\WithSlowThresholdAndMaximumDurationAnnotations\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromAnnotationWhenTestMethodHasMaximumDurationAndSlowThresholdAnnotations ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit11/TestMethod/WithSlowThresholdAnnotation/SleeperTest.php b/test/EndToEnd/PHPUnit11/TestMethod/WithSlowThresholdAnnotation/SleeperTest.php deleted file mode 100644 index c1d2b4610..000000000 --- a/test/EndToEnd/PHPUnit11/TestMethod/WithSlowThresholdAnnotation/SleeperTest.php +++ /dev/null @@ -1,85 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 3.14 - * - * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidSlowThresholdAnnotation(): void - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 200 - * - * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 - */ - public function testSleeperSleepsShorterThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 200 - * - * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 - */ - public function testSleeperSleepsLongerThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit11/TestMethod/WithSlowThresholdAnnotation/phpunit.xml b/test/EndToEnd/PHPUnit11/TestMethod/WithSlowThresholdAnnotation/phpunit.xml deleted file mode 100644 index fb1f0d84f..000000000 --- a/test/EndToEnd/PHPUnit11/TestMethod/WithSlowThresholdAnnotation/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit11/TestMethod/WithSlowThresholdAnnotation/test.phpt b/test/EndToEnd/PHPUnit11/TestMethod/WithSlowThresholdAnnotation/test.phpt deleted file mode 100644 index e2054db45..000000000 --- a/test/EndToEnd/PHPUnit11/TestMethod/WithSlowThresholdAnnotation/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With test methods with @slowThreshold annotations ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -.... 4 / 4 (100%) - -Detected 2 tests where the duration exceeded a custom or the global maximum duration (0.100). - -# Duration Test - Actual Maximum ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestMethod\WithSlowThresholdAnnotation\SleeperTest::testSleeperSleepsLongerThanSlowThresholdFromAnnotationWhenTestMethodHasValidSlowThresholdAnnotation -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit11\TestMethod\WithSlowThresholdAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenTestMethodHasInvalidSlowThresholdAnnotation ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit12/Configuration/Defaults/SleeperTest.php b/test/EndToEnd/PHPUnit12/Configuration/Defaults/SleeperTest.php deleted file mode 100644 index 65ad73e4f..000000000 --- a/test/EndToEnd/PHPUnit12/Configuration/Defaults/SleeperTest.php +++ /dev/null @@ -1,60 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] - public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable - { - $values = \range( - 600, - 1600, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit12/Configuration/Defaults/phpunit.xml b/test/EndToEnd/PHPUnit12/Configuration/Defaults/phpunit.xml deleted file mode 100644 index e296d314d..000000000 --- a/test/EndToEnd/PHPUnit12/Configuration/Defaults/phpunit.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit12/Configuration/Defaults/test.phpt b/test/EndToEnd/PHPUnit12/Configuration/Defaults/test.phpt deleted file mode 100644 index 62f19bb3c..000000000 --- a/test/EndToEnd/PHPUnit12/Configuration/Defaults/test.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -With default configuration ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -............ 12 / 12 (100%) - -Detected 11 tests where the duration exceeded the global maximum duration (0.500). - - # Duration Test ----------%s - 1 1.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1600) - 2 1.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1500) - 3 1.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1400) - 4 1.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1300) - 5 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1200) - 6 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1100) - 7 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1000) - 8 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(900) - 9 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(800) -10 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(700) ----------%s - 0.000 - └─── seconds - -There is 1 additional slow test that is not listed here. - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit12/Configuration/MaximumCount/SleeperTest.php b/test/EndToEnd/PHPUnit12/Configuration/MaximumCount/SleeperTest.php deleted file mode 100644 index 95ae93ed3..000000000 --- a/test/EndToEnd/PHPUnit12/Configuration/MaximumCount/SleeperTest.php +++ /dev/null @@ -1,60 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] - public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable - { - $values = \range( - 600, - 1000, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit12/Configuration/MaximumCount/phpunit.xml b/test/EndToEnd/PHPUnit12/Configuration/MaximumCount/phpunit.xml deleted file mode 100644 index 5979d7828..000000000 --- a/test/EndToEnd/PHPUnit12/Configuration/MaximumCount/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit12/Configuration/MaximumCount/test.phpt b/test/EndToEnd/PHPUnit12/Configuration/MaximumCount/test.phpt deleted file mode 100644 index f8e3486bd..000000000 --- a/test/EndToEnd/PHPUnit12/Configuration/MaximumCount/test.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -With custom configuration setting the "maximum-count" parameter in the XML configuration file ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -...... 6 / 6 (100%) - -Detected 5 tests where the duration exceeded the global maximum duration (0.500). - -# Duration Test ----------%s -1 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1000) -2 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(900) -3 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(800) ----------%s - 0.000 - └─── seconds - -There are 2 additional slow tests that are not listed here. - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit12/Configuration/MaximumDuration/SleeperTest.php b/test/EndToEnd/PHPUnit12/Configuration/MaximumDuration/SleeperTest.php deleted file mode 100644 index 66b23ec07..000000000 --- a/test/EndToEnd/PHPUnit12/Configuration/MaximumDuration/SleeperTest.php +++ /dev/null @@ -1,60 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 1200, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit12/Configuration/MaximumDuration/phpunit.xml b/test/EndToEnd/PHPUnit12/Configuration/MaximumDuration/phpunit.xml deleted file mode 100644 index b42542b30..000000000 --- a/test/EndToEnd/PHPUnit12/Configuration/MaximumDuration/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit12/Configuration/MaximumDuration/test.phpt b/test/EndToEnd/PHPUnit12/Configuration/MaximumDuration/test.phpt deleted file mode 100644 index 8e57f53d1..000000000 --- a/test/EndToEnd/PHPUnit12/Configuration/MaximumDuration/test.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -With custom configuration setting the "maximum-duration" parameter in the XML configuration file ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -............ 12 / 12 (100%) - -Detected 11 tests where the duration exceeded the global maximum duration (0.100). - - # Duration Test ----------%s - 1 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(1200) - 2 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(1100) - 3 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(1000) - 4 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(900) - 5 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(800) - 6 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(700) - 7 0.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(600) - 8 0.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(500) - 9 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(400) -10 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) ----------%s - 0.000 - └─── seconds - -There is 1 additional slow test that is not listed here. - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit12/Configuration/Stderr/SleeperTest.php b/test/EndToEnd/PHPUnit12/Configuration/Stderr/SleeperTest.php deleted file mode 100644 index b4358cd27..000000000 --- a/test/EndToEnd/PHPUnit12/Configuration/Stderr/SleeperTest.php +++ /dev/null @@ -1,60 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] - public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable - { - $values = \range( - 600, - 1600, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit12/Configuration/Stderr/phpunit.xml b/test/EndToEnd/PHPUnit12/Configuration/Stderr/phpunit.xml deleted file mode 100644 index 9f3882377..000000000 --- a/test/EndToEnd/PHPUnit12/Configuration/Stderr/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit12/Configuration/Stderr/test.phpt b/test/EndToEnd/PHPUnit12/Configuration/Stderr/test.phpt deleted file mode 100644 index c816e9fcc..000000000 --- a/test/EndToEnd/PHPUnit12/Configuration/Stderr/test.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -With configuration setting stderr to true ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -............ 12 / 12 (100%) - -Detected 11 tests where the duration exceeded the global maximum duration (0.500). - - # Duration Test ----------%s - 1 1.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1600) - 2 1.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1500) - 3 1.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1400) - 4 1.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1300) - 5 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1200) - 6 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1100) - 7 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1000) - 8 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(900) - 9 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(800) -10 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(700) ----------%s - 0.000 - └─── seconds - -There is 1 additional slow test that is not listed here. - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit12/Console/Configuration/Defaults/SleeperTest.php b/test/EndToEnd/PHPUnit12/Console/Configuration/Defaults/SleeperTest.php new file mode 100644 index 000000000..9b9f1aa13 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/Configuration/Defaults/SleeperTest.php @@ -0,0 +1,60 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] + public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable + { + $values = \range( + 600, + 1600, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit12/Console/Configuration/Defaults/phpunit.xml b/test/EndToEnd/PHPUnit12/Console/Configuration/Defaults/phpunit.xml new file mode 100644 index 000000000..c084e4662 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/Configuration/Defaults/phpunit.xml @@ -0,0 +1,32 @@ + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit12/Console/Configuration/Defaults/test.phpt b/test/EndToEnd/PHPUnit12/Console/Configuration/Defaults/test.phpt new file mode 100644 index 000000000..1ac4b3503 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/Configuration/Defaults/test.phpt @@ -0,0 +1,43 @@ +--TEST-- +With default configuration +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +............ 12 / 12 (100%) + +Detected 11 tests where the duration exceeded the global maximum duration (0.500). + + # Duration Test +---------%s + 1 1.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1600) + 2 1.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1500) + 3 1.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1400) + 4 1.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1300) + 5 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1200) + 6 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1100) + 7 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1000) + 8 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(900) + 9 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(800) +10 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(700) +---------%s + 0.000 + └─── seconds + +There is 1 additional slow test that is not listed here. + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit12/Console/Configuration/MaximumCount/SleeperTest.php b/test/EndToEnd/PHPUnit12/Console/Configuration/MaximumCount/SleeperTest.php new file mode 100644 index 000000000..4dcd3f249 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/Configuration/MaximumCount/SleeperTest.php @@ -0,0 +1,60 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] + public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable + { + $values = \range( + 600, + 1000, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit12/Console/Configuration/MaximumCount/phpunit.xml b/test/EndToEnd/PHPUnit12/Console/Configuration/MaximumCount/phpunit.xml new file mode 100644 index 000000000..dbf7287ea --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/Configuration/MaximumCount/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit12/Console/Configuration/MaximumCount/test.phpt b/test/EndToEnd/PHPUnit12/Console/Configuration/MaximumCount/test.phpt new file mode 100644 index 000000000..33581fc48 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/Configuration/MaximumCount/test.phpt @@ -0,0 +1,36 @@ +--TEST-- +With custom configuration setting the "maximum-count" parameter in the XML configuration file +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +...... 6 / 6 (100%) + +Detected 5 tests where the duration exceeded the global maximum duration (0.500). + +# Duration Test +---------%s +1 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1000) +2 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(900) +3 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(800) +---------%s + 0.000 + └─── seconds + +There are 2 additional slow tests that are not listed here. + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit12/Console/Configuration/MaximumDuration/SleeperTest.php b/test/EndToEnd/PHPUnit12/Console/Configuration/MaximumDuration/SleeperTest.php new file mode 100644 index 000000000..acfc90a1c --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/Configuration/MaximumDuration/SleeperTest.php @@ -0,0 +1,60 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 1200, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit12/Console/Configuration/MaximumDuration/phpunit.xml b/test/EndToEnd/PHPUnit12/Console/Configuration/MaximumDuration/phpunit.xml new file mode 100644 index 000000000..af2e79380 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/Configuration/MaximumDuration/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit12/Console/Configuration/MaximumDuration/test.phpt b/test/EndToEnd/PHPUnit12/Console/Configuration/MaximumDuration/test.phpt new file mode 100644 index 000000000..55c47e393 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/Configuration/MaximumDuration/test.phpt @@ -0,0 +1,43 @@ +--TEST-- +With custom configuration setting the "maximum-duration" parameter in the XML configuration file +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +............ 12 / 12 (100%) + +Detected 11 tests where the duration exceeded the global maximum duration (0.100). + + # Duration Test +---------%s + 1 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(1200) + 2 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(1100) + 3 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(1000) + 4 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(900) + 5 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(800) + 6 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(700) + 7 0.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(600) + 8 0.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(500) + 9 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(400) +10 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +---------%s + 0.000 + └─── seconds + +There is 1 additional slow test that is not listed here. + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit12/Console/Configuration/Stderr/SleeperTest.php b/test/EndToEnd/PHPUnit12/Console/Configuration/Stderr/SleeperTest.php new file mode 100644 index 000000000..684c3ab56 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/Configuration/Stderr/SleeperTest.php @@ -0,0 +1,60 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] + public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable + { + $values = \range( + 600, + 1600, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit12/Console/Configuration/Stderr/phpunit.xml b/test/EndToEnd/PHPUnit12/Console/Configuration/Stderr/phpunit.xml new file mode 100644 index 000000000..14aa92b72 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/Configuration/Stderr/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit12/Console/Configuration/Stderr/test.phpt b/test/EndToEnd/PHPUnit12/Console/Configuration/Stderr/test.phpt new file mode 100644 index 000000000..7da7f4d4d --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/Configuration/Stderr/test.phpt @@ -0,0 +1,43 @@ +--TEST-- +With configuration setting stderr to true +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +............ 12 / 12 (100%) + +Detected 11 tests where the duration exceeded the global maximum duration (0.500). + + # Duration Test +---------%s + 1 1.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1600) + 2 1.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1500) + 3 1.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1400) + 4 1.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1300) + 5 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1200) + 6 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1100) + 7 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1000) + 8 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(900) + 9 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(800) +10 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(700) +---------%s + 0.000 + └─── seconds + +There is 1 additional slow test that is not listed here. + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit12/Console/Option/NoOutput/SleeperTest.php b/test/EndToEnd/PHPUnit12/Console/Option/NoOutput/SleeperTest.php new file mode 100644 index 000000000..ad8fdd8cd --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/Option/NoOutput/SleeperTest.php @@ -0,0 +1,32 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit12/Console/Option/NoOutput/phpunit.xml b/test/EndToEnd/PHPUnit12/Console/Option/NoOutput/phpunit.xml new file mode 100644 index 000000000..836afd7eb --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/Option/NoOutput/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit12/Console/Option/NoOutput/test.phpt b/test/EndToEnd/PHPUnit12/Console/Option/NoOutput/test.phpt new file mode 100644 index 000000000..5108a4bc0 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/Option/NoOutput/test.phpt @@ -0,0 +1,18 @@ +--TEST-- +With default configuration of extension +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/Bare/SleeperTest.php b/test/EndToEnd/PHPUnit12/Console/TestCase/Bare/SleeperTest.php new file mode 100644 index 000000000..df1d82d6c --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/Bare/SleeperTest.php @@ -0,0 +1,60 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/Bare/phpunit.xml b/test/EndToEnd/PHPUnit12/Console/TestCase/Bare/phpunit.xml new file mode 100644 index 000000000..836afd7eb --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/Bare/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/Bare/test.phpt b/test/EndToEnd/PHPUnit12/Console/TestCase/Bare/test.phpt new file mode 100644 index 000000000..5d8201048 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/Bare/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that does not sleep in methods that are not test methods +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\Bare\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\Bare\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/Combination/SleeperTest.php b/test/EndToEnd/PHPUnit12/Console/TestCase/Combination/SleeperTest.php new file mode 100644 index 000000000..60e10787f --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/Combination/SleeperTest.php @@ -0,0 +1,116 @@ +sleep(); + } + + public static function tearDownAfterClass(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function setUp(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPreConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPostConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function tearDown(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\Before] + public function sleepWithBeforeAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\BeforeClass] + public static function sleepWithBeforeClassAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\After] + public function sleepWithAfterAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\AfterClass] + public static function sleepWithAfterClassAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/Combination/phpunit.xml b/test/EndToEnd/PHPUnit12/Console/TestCase/Combination/phpunit.xml new file mode 100644 index 000000000..836afd7eb --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/Combination/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/Combination/test.phpt b/test/EndToEnd/PHPUnit12/Console/TestCase/Combination/test.phpt new file mode 100644 index 000000000..6bf932d42 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/Combination/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in data provider, hook, and test methods +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\Combination\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\Combination\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +3 0.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\Combination\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithAfterAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAfterAttribute/SleeperTest.php new file mode 100644 index 000000000..e1818c10a --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAfterAttribute/SleeperTest.php @@ -0,0 +1,66 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithAfterAttribute/phpunit.xml b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAfterAttribute/phpunit.xml new file mode 100644 index 000000000..836afd7eb --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAfterAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithAfterAttribute/test.phpt b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAfterAttribute/test.phpt new file mode 100644 index 000000000..bd6e08c71 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAfterAttribute/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in a method with After attribute +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithAfterClassAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAfterClassAttribute/SleeperTest.php new file mode 100644 index 000000000..6d8320051 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAfterClassAttribute/SleeperTest.php @@ -0,0 +1,66 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithAfterClassAttribute/phpunit.xml b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAfterClassAttribute/phpunit.xml new file mode 100644 index 000000000..836afd7eb --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAfterClassAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithAfterClassAttribute/test.phpt b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAfterClassAttribute/test.phpt new file mode 100644 index 000000000..ca406bdea --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAfterClassAttribute/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a method with AfterClass attribute +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithAfterClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithAfterClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithAssertPostConditions/SleeperTest.php b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAssertPostConditions/SleeperTest.php new file mode 100644 index 000000000..d03bda91c --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAssertPostConditions/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithAssertPostConditions/phpunit.xml b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAssertPostConditions/phpunit.xml new file mode 100644 index 000000000..836afd7eb --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAssertPostConditions/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithAssertPostConditions/test.phpt b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAssertPostConditions/test.phpt new file mode 100644 index 000000000..28f472b90 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAssertPostConditions/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in assertPostConditions() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithAssertPreConditions/SleeperTest.php b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAssertPreConditions/SleeperTest.php new file mode 100644 index 000000000..1cdd1ef3a --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAssertPreConditions/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithAssertPreConditions/phpunit.xml b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAssertPreConditions/phpunit.xml new file mode 100644 index 000000000..836afd7eb --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAssertPreConditions/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithAssertPreConditions/test.phpt b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAssertPreConditions/test.phpt new file mode 100644 index 000000000..4b9d98b72 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithAssertPreConditions/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in assertPreConditions() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithBeforeAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit12/Console/TestCase/WithBeforeAttribute/SleeperTest.php new file mode 100644 index 000000000..a4dcdb016 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithBeforeAttribute/SleeperTest.php @@ -0,0 +1,66 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithBeforeAttribute/phpunit.xml b/test/EndToEnd/PHPUnit12/Console/TestCase/WithBeforeAttribute/phpunit.xml new file mode 100644 index 000000000..836afd7eb --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithBeforeAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithBeforeAttribute/test.phpt b/test/EndToEnd/PHPUnit12/Console/TestCase/WithBeforeAttribute/test.phpt new file mode 100644 index 000000000..f0a2c4e1e --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithBeforeAttribute/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in a method with Before attribute +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithBeforeClassAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit12/Console/TestCase/WithBeforeClassAttribute/SleeperTest.php new file mode 100644 index 000000000..3f0f8780b --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithBeforeClassAttribute/SleeperTest.php @@ -0,0 +1,66 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithBeforeClassAttribute/phpunit.xml b/test/EndToEnd/PHPUnit12/Console/TestCase/WithBeforeClassAttribute/phpunit.xml new file mode 100644 index 000000000..836afd7eb --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithBeforeClassAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithBeforeClassAttribute/test.phpt b/test/EndToEnd/PHPUnit12/Console/TestCase/WithBeforeClassAttribute/test.phpt new file mode 100644 index 000000000..2005b57be --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithBeforeClassAttribute/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a method with BeforeClass attribute +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithBeforeClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithBeforeClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithDataProvider/SleeperTest.php b/test/EndToEnd/PHPUnit12/Console/TestCase/WithDataProvider/SleeperTest.php new file mode 100644 index 000000000..84a38d889 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithDataProvider/SleeperTest.php @@ -0,0 +1,62 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithDataProvider/phpunit.xml b/test/EndToEnd/PHPUnit12/Console/TestCase/WithDataProvider/phpunit.xml new file mode 100644 index 000000000..836afd7eb --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithDataProvider/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithDataProvider/test.phpt b/test/EndToEnd/PHPUnit12/Console/TestCase/WithDataProvider/test.phpt new file mode 100644 index 000000000..326c875b2 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithDataProvider/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a data provider +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithDataProvider\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithDataProvider\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithSetUp/SleeperTest.php b/test/EndToEnd/PHPUnit12/Console/TestCase/WithSetUp/SleeperTest.php new file mode 100644 index 000000000..d4b88a320 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithSetUp/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithSetUp/phpunit.xml b/test/EndToEnd/PHPUnit12/Console/TestCase/WithSetUp/phpunit.xml new file mode 100644 index 000000000..836afd7eb --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithSetUp/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithSetUp/test.phpt b/test/EndToEnd/PHPUnit12/Console/TestCase/WithSetUp/test.phpt new file mode 100644 index 000000000..8806ebd64 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithSetUp/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in a setUp() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithSetUpBeforeClass/SleeperTest.php b/test/EndToEnd/PHPUnit12/Console/TestCase/WithSetUpBeforeClass/SleeperTest.php new file mode 100644 index 000000000..eeebd1fcc --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithSetUpBeforeClass/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithSetUpBeforeClass/phpunit.xml b/test/EndToEnd/PHPUnit12/Console/TestCase/WithSetUpBeforeClass/phpunit.xml new file mode 100644 index 000000000..836afd7eb --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithSetUpBeforeClass/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithSetUpBeforeClass/test.phpt b/test/EndToEnd/PHPUnit12/Console/TestCase/WithSetUpBeforeClass/test.phpt new file mode 100644 index 000000000..620fab0b5 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithSetUpBeforeClass/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a setUpBeforeClass() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithSetUpBeforeClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithSetUpBeforeClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithTearDown/SleeperTest.php b/test/EndToEnd/PHPUnit12/Console/TestCase/WithTearDown/SleeperTest.php new file mode 100644 index 000000000..ea1e62126 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithTearDown/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithTearDown/phpunit.xml b/test/EndToEnd/PHPUnit12/Console/TestCase/WithTearDown/phpunit.xml new file mode 100644 index 000000000..836afd7eb --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithTearDown/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithTearDown/test.phpt b/test/EndToEnd/PHPUnit12/Console/TestCase/WithTearDown/test.phpt new file mode 100644 index 000000000..a216ddf62 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithTearDown/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in a tearDown() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithTearDownAfterClass/SleeperTest.php b/test/EndToEnd/PHPUnit12/Console/TestCase/WithTearDownAfterClass/SleeperTest.php new file mode 100644 index 000000000..d52dd9945 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithTearDownAfterClass/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithTearDownAfterClass/phpunit.xml b/test/EndToEnd/PHPUnit12/Console/TestCase/WithTearDownAfterClass/phpunit.xml new file mode 100644 index 000000000..836afd7eb --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithTearDownAfterClass/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithTearDownAfterClass/test.phpt b/test/EndToEnd/PHPUnit12/Console/TestCase/WithTearDownAfterClass/test.phpt new file mode 100644 index 000000000..3d15af05f --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithTearDownAfterClass/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a tearDownAfterClass() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithTearDownAfterClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithTearDownAfterClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithoutTestMethods/SleeperTest.php b/test/EndToEnd/PHPUnit12/Console/TestCase/WithoutTestMethods/SleeperTest.php new file mode 100644 index 000000000..e3f0e8da7 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithoutTestMethods/SleeperTest.php @@ -0,0 +1,23 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit12/Console/TestCase/WithoutTestMethods/test.phpt b/test/EndToEnd/PHPUnit12/Console/TestCase/WithoutTestMethods/test.phpt new file mode 100644 index 000000000..1ee019d15 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestCase/WithoutTestMethods/test.phpt @@ -0,0 +1,24 @@ +--TEST-- +With a test case that has no test methods +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +There was 1 PHPUnit test runner warning: + +1) No tests found in class "Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestCase\WithoutTestMethods\SleeperTest". + +No tests executed! diff --git a/test/EndToEnd/PHPUnit12/Console/TestMethod/WithMaximumDurationAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit12/Console/TestMethod/WithMaximumDurationAttribute/SleeperTest.php new file mode 100644 index 000000000..976b3f92a --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestMethod/WithMaximumDurationAttribute/SleeperTest.php @@ -0,0 +1,46 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Attribute\MaximumDuration(200)] + public function testSleeperSleepsLongerThanMaximumDurationFromAttributeWhenTestMethodHasValidMaximumDurationAttribute(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit12/Console/TestMethod/WithMaximumDurationAttribute/phpunit.xml b/test/EndToEnd/PHPUnit12/Console/TestMethod/WithMaximumDurationAttribute/phpunit.xml new file mode 100644 index 000000000..836afd7eb --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestMethod/WithMaximumDurationAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit12/Console/TestMethod/WithMaximumDurationAttribute/test.phpt b/test/EndToEnd/PHPUnit12/Console/TestMethod/WithMaximumDurationAttribute/test.phpt new file mode 100644 index 000000000..8393545bf --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestMethod/WithMaximumDurationAttribute/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With test methods with @maximumDuration Attributes +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +.. 2 / 2 (100%) + +Detected 1 test where the duration exceeded a custom or the global maximum duration (0.100). + +# Duration Test + Actual Maximum +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestMethod\WithMaximumDurationAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromAttributeWhenTestMethodHasValidMaximumDurationAttribute +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit12/Console/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit12/Console/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php new file mode 100644 index 000000000..19aea7052 --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php @@ -0,0 +1,121 @@ +sleep(); + } + + public static function tearDownAfterClass(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function setUp(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPreConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPostConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function tearDown(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\Before] + public function sleepWithBeforeAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\BeforeClass] + public static function sleepWithBeforeClassAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\After] + public function sleepWithAfterAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\AfterClass] + public static function sleepWithAfterClassAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 50; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\RunInSeparateProcess] + public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 200; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\RunInSeparateProcess] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit12/Console/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml b/test/EndToEnd/PHPUnit12/Console/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml new file mode 100644 index 000000000..836afd7eb --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit12/Console/TestMethod/WithRunInSeparateProcessAttribute/test.phpt b/test/EndToEnd/PHPUnit12/Console/TestMethod/WithRunInSeparateProcessAttribute/test.phpt new file mode 100644 index 000000000..60653d12b --- /dev/null +++ b/test/EndToEnd/PHPUnit12/Console/TestMethod/WithRunInSeparateProcessAttribute/test.phpt @@ -0,0 +1,40 @@ +--TEST-- +With a test case that sleeps in data provider, hook, and test methods and has test methods with RunInSeparateProcess attribute +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +.... 4 / 4 (100%) + +Detected 4 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +1 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute +2 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute +3 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration +4 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\Console\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit12/Option/NoOutput/SleeperTest.php b/test/EndToEnd/PHPUnit12/Option/NoOutput/SleeperTest.php deleted file mode 100644 index e1e22cf51..000000000 --- a/test/EndToEnd/PHPUnit12/Option/NoOutput/SleeperTest.php +++ /dev/null @@ -1,32 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit12/Option/NoOutput/phpunit.xml b/test/EndToEnd/PHPUnit12/Option/NoOutput/phpunit.xml deleted file mode 100644 index f3c8d23f0..000000000 --- a/test/EndToEnd/PHPUnit12/Option/NoOutput/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit12/Option/NoOutput/test.phpt b/test/EndToEnd/PHPUnit12/Option/NoOutput/test.phpt deleted file mode 100644 index da2428985..000000000 --- a/test/EndToEnd/PHPUnit12/Option/NoOutput/test.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -With default configuration of extension ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- diff --git a/test/EndToEnd/PHPUnit12/TestCase/Bare/SleeperTest.php b/test/EndToEnd/PHPUnit12/TestCase/Bare/SleeperTest.php deleted file mode 100644 index e27a16d61..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/Bare/SleeperTest.php +++ /dev/null @@ -1,60 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit12/TestCase/Bare/phpunit.xml b/test/EndToEnd/PHPUnit12/TestCase/Bare/phpunit.xml deleted file mode 100644 index f3c8d23f0..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/Bare/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit12/TestCase/Bare/test.phpt b/test/EndToEnd/PHPUnit12/TestCase/Bare/test.phpt deleted file mode 100644 index 5b7595238..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/Bare/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that does not sleep in methods that are not test methods ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\Bare\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\Bare\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit12/TestCase/Combination/SleeperTest.php b/test/EndToEnd/PHPUnit12/TestCase/Combination/SleeperTest.php deleted file mode 100644 index dd4687202..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/Combination/SleeperTest.php +++ /dev/null @@ -1,116 +0,0 @@ -sleep(); - } - - public static function tearDownAfterClass(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function setUp(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPreConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPostConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function tearDown(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\Before] - public function sleepWithBeforeAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\BeforeClass] - public static function sleepWithBeforeClassAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\After] - public function sleepWithAfterAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\AfterClass] - public static function sleepWithAfterClassAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit12/TestCase/Combination/phpunit.xml b/test/EndToEnd/PHPUnit12/TestCase/Combination/phpunit.xml deleted file mode 100644 index f3c8d23f0..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/Combination/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit12/TestCase/Combination/test.phpt b/test/EndToEnd/PHPUnit12/TestCase/Combination/test.phpt deleted file mode 100644 index 9d89953b3..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/Combination/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in data provider, hook, and test methods ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\Combination\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\Combination\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) -3 0.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\Combination\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithAfterAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit12/TestCase/WithAfterAttribute/SleeperTest.php deleted file mode 100644 index ac9ab8896..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithAfterAttribute/SleeperTest.php +++ /dev/null @@ -1,66 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithAfterAttribute/phpunit.xml b/test/EndToEnd/PHPUnit12/TestCase/WithAfterAttribute/phpunit.xml deleted file mode 100644 index f3c8d23f0..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithAfterAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithAfterAttribute/test.phpt b/test/EndToEnd/PHPUnit12/TestCase/WithAfterAttribute/test.phpt deleted file mode 100644 index c41b5774d..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithAfterAttribute/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with After attribute ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithAfterClassAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit12/TestCase/WithAfterClassAttribute/SleeperTest.php deleted file mode 100644 index cd9d3531e..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithAfterClassAttribute/SleeperTest.php +++ /dev/null @@ -1,66 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithAfterClassAttribute/phpunit.xml b/test/EndToEnd/PHPUnit12/TestCase/WithAfterClassAttribute/phpunit.xml deleted file mode 100644 index f3c8d23f0..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithAfterClassAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithAfterClassAttribute/test.phpt b/test/EndToEnd/PHPUnit12/TestCase/WithAfterClassAttribute/test.phpt deleted file mode 100644 index 404ee48d2..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithAfterClassAttribute/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with AfterClass attribute ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithAfterClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithAfterClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithAssertPostConditions/SleeperTest.php b/test/EndToEnd/PHPUnit12/TestCase/WithAssertPostConditions/SleeperTest.php deleted file mode 100644 index 7499dcffc..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithAssertPostConditions/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithAssertPostConditions/phpunit.xml b/test/EndToEnd/PHPUnit12/TestCase/WithAssertPostConditions/phpunit.xml deleted file mode 100644 index f3c8d23f0..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithAssertPostConditions/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithAssertPostConditions/test.phpt b/test/EndToEnd/PHPUnit12/TestCase/WithAssertPostConditions/test.phpt deleted file mode 100644 index 052f2aef8..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithAssertPostConditions/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in assertPostConditions() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithAssertPreConditions/SleeperTest.php b/test/EndToEnd/PHPUnit12/TestCase/WithAssertPreConditions/SleeperTest.php deleted file mode 100644 index 47aec171c..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithAssertPreConditions/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithAssertPreConditions/phpunit.xml b/test/EndToEnd/PHPUnit12/TestCase/WithAssertPreConditions/phpunit.xml deleted file mode 100644 index f3c8d23f0..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithAssertPreConditions/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithAssertPreConditions/test.phpt b/test/EndToEnd/PHPUnit12/TestCase/WithAssertPreConditions/test.phpt deleted file mode 100644 index b3a125baf..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithAssertPreConditions/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in assertPreConditions() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithBeforeAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit12/TestCase/WithBeforeAttribute/SleeperTest.php deleted file mode 100644 index 975797da3..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithBeforeAttribute/SleeperTest.php +++ /dev/null @@ -1,66 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithBeforeAttribute/phpunit.xml b/test/EndToEnd/PHPUnit12/TestCase/WithBeforeAttribute/phpunit.xml deleted file mode 100644 index f3c8d23f0..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithBeforeAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithBeforeAttribute/test.phpt b/test/EndToEnd/PHPUnit12/TestCase/WithBeforeAttribute/test.phpt deleted file mode 100644 index fb7000b17..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithBeforeAttribute/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with Before attribute ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithBeforeClassAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit12/TestCase/WithBeforeClassAttribute/SleeperTest.php deleted file mode 100644 index 0e9cec9a3..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithBeforeClassAttribute/SleeperTest.php +++ /dev/null @@ -1,66 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithBeforeClassAttribute/phpunit.xml b/test/EndToEnd/PHPUnit12/TestCase/WithBeforeClassAttribute/phpunit.xml deleted file mode 100644 index f3c8d23f0..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithBeforeClassAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithBeforeClassAttribute/test.phpt b/test/EndToEnd/PHPUnit12/TestCase/WithBeforeClassAttribute/test.phpt deleted file mode 100644 index e72989529..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithBeforeClassAttribute/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with BeforeClass attribute ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithBeforeClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithBeforeClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithDataProvider/SleeperTest.php b/test/EndToEnd/PHPUnit12/TestCase/WithDataProvider/SleeperTest.php deleted file mode 100644 index 86f2b5f7a..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithDataProvider/SleeperTest.php +++ /dev/null @@ -1,62 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithDataProvider/phpunit.xml b/test/EndToEnd/PHPUnit12/TestCase/WithDataProvider/phpunit.xml deleted file mode 100644 index f3c8d23f0..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithDataProvider/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithDataProvider/test.phpt b/test/EndToEnd/PHPUnit12/TestCase/WithDataProvider/test.phpt deleted file mode 100644 index 7e4100dec..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithDataProvider/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a data provider ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithDataProvider\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithDataProvider\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithSetUp/SleeperTest.php b/test/EndToEnd/PHPUnit12/TestCase/WithSetUp/SleeperTest.php deleted file mode 100644 index 7e88a0044..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithSetUp/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithSetUp/phpunit.xml b/test/EndToEnd/PHPUnit12/TestCase/WithSetUp/phpunit.xml deleted file mode 100644 index f3c8d23f0..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithSetUp/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithSetUp/test.phpt b/test/EndToEnd/PHPUnit12/TestCase/WithSetUp/test.phpt deleted file mode 100644 index f0124aa14..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithSetUp/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in a setUp() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithSetUpBeforeClass/SleeperTest.php b/test/EndToEnd/PHPUnit12/TestCase/WithSetUpBeforeClass/SleeperTest.php deleted file mode 100644 index 1175d8ee8..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithSetUpBeforeClass/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithSetUpBeforeClass/phpunit.xml b/test/EndToEnd/PHPUnit12/TestCase/WithSetUpBeforeClass/phpunit.xml deleted file mode 100644 index f3c8d23f0..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithSetUpBeforeClass/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithSetUpBeforeClass/test.phpt b/test/EndToEnd/PHPUnit12/TestCase/WithSetUpBeforeClass/test.phpt deleted file mode 100644 index f31f16124..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithSetUpBeforeClass/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a setUpBeforeClass() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithSetUpBeforeClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithSetUpBeforeClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithTearDown/SleeperTest.php b/test/EndToEnd/PHPUnit12/TestCase/WithTearDown/SleeperTest.php deleted file mode 100644 index 59421e374..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithTearDown/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithTearDown/phpunit.xml b/test/EndToEnd/PHPUnit12/TestCase/WithTearDown/phpunit.xml deleted file mode 100644 index f3c8d23f0..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithTearDown/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithTearDown/test.phpt b/test/EndToEnd/PHPUnit12/TestCase/WithTearDown/test.phpt deleted file mode 100644 index 382256db6..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithTearDown/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in a tearDown() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithTearDownAfterClass/SleeperTest.php b/test/EndToEnd/PHPUnit12/TestCase/WithTearDownAfterClass/SleeperTest.php deleted file mode 100644 index aee786fdc..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithTearDownAfterClass/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithTearDownAfterClass/phpunit.xml b/test/EndToEnd/PHPUnit12/TestCase/WithTearDownAfterClass/phpunit.xml deleted file mode 100644 index f3c8d23f0..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithTearDownAfterClass/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithTearDownAfterClass/test.phpt b/test/EndToEnd/PHPUnit12/TestCase/WithTearDownAfterClass/test.phpt deleted file mode 100644 index 12a7c5b2f..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithTearDownAfterClass/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a tearDownAfterClass() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithTearDownAfterClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithTearDownAfterClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithoutTestMethods/SleeperTest.php b/test/EndToEnd/PHPUnit12/TestCase/WithoutTestMethods/SleeperTest.php deleted file mode 100644 index 25160e7ea..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithoutTestMethods/SleeperTest.php +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit12/TestCase/WithoutTestMethods/test.phpt b/test/EndToEnd/PHPUnit12/TestCase/WithoutTestMethods/test.phpt deleted file mode 100644 index edefd1d5d..000000000 --- a/test/EndToEnd/PHPUnit12/TestCase/WithoutTestMethods/test.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -With a test case that has no test methods ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -There was 1 PHPUnit test runner warning: - -1) No tests found in class "Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestCase\WithoutTestMethods\SleeperTest". - -No tests executed! diff --git a/test/EndToEnd/PHPUnit12/TestMethod/WithMaximumDurationAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit12/TestMethod/WithMaximumDurationAttribute/SleeperTest.php deleted file mode 100644 index df6bd8b82..000000000 --- a/test/EndToEnd/PHPUnit12/TestMethod/WithMaximumDurationAttribute/SleeperTest.php +++ /dev/null @@ -1,46 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Attribute\MaximumDuration(200)] - public function testSleeperSleepsLongerThanMaximumDurationFromAttributeWhenTestMethodHasValidMaximumDurationAttribute(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit12/TestMethod/WithMaximumDurationAttribute/phpunit.xml b/test/EndToEnd/PHPUnit12/TestMethod/WithMaximumDurationAttribute/phpunit.xml deleted file mode 100644 index f3c8d23f0..000000000 --- a/test/EndToEnd/PHPUnit12/TestMethod/WithMaximumDurationAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit12/TestMethod/WithMaximumDurationAttribute/test.phpt b/test/EndToEnd/PHPUnit12/TestMethod/WithMaximumDurationAttribute/test.phpt deleted file mode 100644 index e788380ec..000000000 --- a/test/EndToEnd/PHPUnit12/TestMethod/WithMaximumDurationAttribute/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With test methods with @maximumDuration Attributes ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -.. 2 / 2 (100%) - -Detected 1 test where the duration exceeded a custom or the global maximum duration (0.100). - -# Duration Test - Actual Maximum ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestMethod\WithMaximumDurationAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromAttributeWhenTestMethodHasValidMaximumDurationAttribute ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit12/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit12/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php deleted file mode 100644 index b82f0eede..000000000 --- a/test/EndToEnd/PHPUnit12/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php +++ /dev/null @@ -1,121 +0,0 @@ -sleep(); - } - - public static function tearDownAfterClass(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function setUp(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPreConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPostConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function tearDown(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\Before] - public function sleepWithBeforeAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\BeforeClass] - public static function sleepWithBeforeClassAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\After] - public function sleepWithAfterAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\AfterClass] - public static function sleepWithAfterClassAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 50; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\RunInSeparateProcess] - public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\RunInSeparateProcess] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit12/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml b/test/EndToEnd/PHPUnit12/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml deleted file mode 100644 index f3c8d23f0..000000000 --- a/test/EndToEnd/PHPUnit12/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit12/TestMethod/WithRunInSeparateProcessAttribute/test.phpt b/test/EndToEnd/PHPUnit12/TestMethod/WithRunInSeparateProcessAttribute/test.phpt deleted file mode 100644 index 0671b2d01..000000000 --- a/test/EndToEnd/PHPUnit12/TestMethod/WithRunInSeparateProcessAttribute/test.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -With a test case that sleeps in data provider, hook, and test methods and has test methods with RunInSeparateProcess attribute ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -.... 4 / 4 (100%) - -Detected 4 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute -2 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute -3 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration -4 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit12\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit13/Configuration/Defaults/SleeperTest.php b/test/EndToEnd/PHPUnit13/Configuration/Defaults/SleeperTest.php deleted file mode 100644 index 60b0c2daf..000000000 --- a/test/EndToEnd/PHPUnit13/Configuration/Defaults/SleeperTest.php +++ /dev/null @@ -1,60 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] - public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable - { - $values = \range( - 600, - 1600, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit13/Configuration/Defaults/phpunit.xml b/test/EndToEnd/PHPUnit13/Configuration/Defaults/phpunit.xml deleted file mode 100644 index 2ae576402..000000000 --- a/test/EndToEnd/PHPUnit13/Configuration/Defaults/phpunit.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit13/Configuration/Defaults/test.phpt b/test/EndToEnd/PHPUnit13/Configuration/Defaults/test.phpt deleted file mode 100644 index a8e4625f3..000000000 --- a/test/EndToEnd/PHPUnit13/Configuration/Defaults/test.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -With default configuration ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -............ 12 / 12 (100%) - -Detected 11 tests where the duration exceeded the global maximum duration (0.500). - - # Duration Test ----------%s - 1 1.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1600) - 2 1.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1500) - 3 1.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1400) - 4 1.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1300) - 5 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1200) - 6 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1100) - 7 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1000) - 8 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(900) - 9 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(800) -10 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(700) ----------%s - 0.000 - └─── seconds - -There is 1 additional slow test that is not listed here. - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit13/Configuration/MaximumCount/SleeperTest.php b/test/EndToEnd/PHPUnit13/Configuration/MaximumCount/SleeperTest.php deleted file mode 100644 index f4dc671d3..000000000 --- a/test/EndToEnd/PHPUnit13/Configuration/MaximumCount/SleeperTest.php +++ /dev/null @@ -1,60 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] - public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable - { - $values = \range( - 600, - 1000, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit13/Configuration/MaximumCount/phpunit.xml b/test/EndToEnd/PHPUnit13/Configuration/MaximumCount/phpunit.xml deleted file mode 100644 index 01f330a20..000000000 --- a/test/EndToEnd/PHPUnit13/Configuration/MaximumCount/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit13/Configuration/MaximumCount/test.phpt b/test/EndToEnd/PHPUnit13/Configuration/MaximumCount/test.phpt deleted file mode 100644 index 1527636b5..000000000 --- a/test/EndToEnd/PHPUnit13/Configuration/MaximumCount/test.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -With custom configuration setting the "maximum-count" parameter in the XML configuration file ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -...... 6 / 6 (100%) - -Detected 5 tests where the duration exceeded the global maximum duration (0.500). - -# Duration Test ----------%s -1 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1000) -2 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(900) -3 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(800) ----------%s - 0.000 - └─── seconds - -There are 2 additional slow tests that are not listed here. - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit13/Configuration/MaximumDuration/SleeperTest.php b/test/EndToEnd/PHPUnit13/Configuration/MaximumDuration/SleeperTest.php deleted file mode 100644 index 50b2df857..000000000 --- a/test/EndToEnd/PHPUnit13/Configuration/MaximumDuration/SleeperTest.php +++ /dev/null @@ -1,60 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 1200, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit13/Configuration/MaximumDuration/phpunit.xml b/test/EndToEnd/PHPUnit13/Configuration/MaximumDuration/phpunit.xml deleted file mode 100644 index e13dd51ce..000000000 --- a/test/EndToEnd/PHPUnit13/Configuration/MaximumDuration/phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit13/Configuration/MaximumDuration/test.phpt b/test/EndToEnd/PHPUnit13/Configuration/MaximumDuration/test.phpt deleted file mode 100644 index 446935273..000000000 --- a/test/EndToEnd/PHPUnit13/Configuration/MaximumDuration/test.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -With custom configuration setting the "maximum-duration" parameter in the XML configuration file ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -............ 12 / 12 (100%) - -Detected 11 tests where the duration exceeded the global maximum duration (0.100). - - # Duration Test ----------%s - 1 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(1200) - 2 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(1100) - 3 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(1000) - 4 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(900) - 5 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(800) - 6 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(700) - 7 0.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(600) - 8 0.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(500) - 9 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(400) -10 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) ----------%s - 0.000 - └─── seconds - -There is 1 additional slow test that is not listed here. - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit13/Configuration/Stderr/SleeperTest.php b/test/EndToEnd/PHPUnit13/Configuration/Stderr/SleeperTest.php deleted file mode 100644 index 504e9a930..000000000 --- a/test/EndToEnd/PHPUnit13/Configuration/Stderr/SleeperTest.php +++ /dev/null @@ -1,60 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] - public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable - { - $values = \range( - 600, - 1600, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit13/Configuration/Stderr/phpunit.xml b/test/EndToEnd/PHPUnit13/Configuration/Stderr/phpunit.xml deleted file mode 100644 index be33a7e98..000000000 --- a/test/EndToEnd/PHPUnit13/Configuration/Stderr/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit13/Configuration/Stderr/test.phpt b/test/EndToEnd/PHPUnit13/Configuration/Stderr/test.phpt deleted file mode 100644 index 6e1617a69..000000000 --- a/test/EndToEnd/PHPUnit13/Configuration/Stderr/test.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -With configuration setting stderr to true ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -............ 12 / 12 (100%) - -Detected 11 tests where the duration exceeded the global maximum duration (0.500). - - # Duration Test ----------%s - 1 1.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1600) - 2 1.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1500) - 3 1.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1400) - 4 1.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1300) - 5 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1200) - 6 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1100) - 7 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1000) - 8 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(900) - 9 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(800) -10 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(700) ----------%s - 0.000 - └─── seconds - -There is 1 additional slow test that is not listed here. - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit13/Console/Configuration/Defaults/SleeperTest.php b/test/EndToEnd/PHPUnit13/Console/Configuration/Defaults/SleeperTest.php new file mode 100644 index 000000000..3bdf23985 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/Configuration/Defaults/SleeperTest.php @@ -0,0 +1,60 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] + public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable + { + $values = \range( + 600, + 1600, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit13/Console/Configuration/Defaults/phpunit.xml b/test/EndToEnd/PHPUnit13/Console/Configuration/Defaults/phpunit.xml new file mode 100644 index 000000000..16b4f2ac8 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/Configuration/Defaults/phpunit.xml @@ -0,0 +1,32 @@ + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit13/Console/Configuration/Defaults/test.phpt b/test/EndToEnd/PHPUnit13/Console/Configuration/Defaults/test.phpt new file mode 100644 index 000000000..a73806083 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/Configuration/Defaults/test.phpt @@ -0,0 +1,43 @@ +--TEST-- +With default configuration +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +............ 12 / 12 (100%) + +Detected 11 tests where the duration exceeded the global maximum duration (0.500). + + # Duration Test +---------%s + 1 1.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1600) + 2 1.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1500) + 3 1.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1400) + 4 1.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1300) + 5 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1200) + 6 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1100) + 7 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1000) + 8 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(900) + 9 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(800) +10 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\Defaults\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(700) +---------%s + 0.000 + └─── seconds + +There is 1 additional slow test that is not listed here. + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit13/Console/Configuration/MaximumCount/SleeperTest.php b/test/EndToEnd/PHPUnit13/Console/Configuration/MaximumCount/SleeperTest.php new file mode 100644 index 000000000..803a0735f --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/Configuration/MaximumCount/SleeperTest.php @@ -0,0 +1,60 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] + public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable + { + $values = \range( + 600, + 1000, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit13/Console/Configuration/MaximumCount/phpunit.xml b/test/EndToEnd/PHPUnit13/Console/Configuration/MaximumCount/phpunit.xml new file mode 100644 index 000000000..ef1f52743 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/Configuration/MaximumCount/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit13/Console/Configuration/MaximumCount/test.phpt b/test/EndToEnd/PHPUnit13/Console/Configuration/MaximumCount/test.phpt new file mode 100644 index 000000000..dfe64b13e --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/Configuration/MaximumCount/test.phpt @@ -0,0 +1,36 @@ +--TEST-- +With custom configuration setting the "maximum-count" parameter in the XML configuration file +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +...... 6 / 6 (100%) + +Detected 5 tests where the duration exceeded the global maximum duration (0.500). + +# Duration Test +---------%s +1 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1000) +2 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(900) +3 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\MaximumCount\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(800) +---------%s + 0.000 + └─── seconds + +There are 2 additional slow tests that are not listed here. + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit13/Console/Configuration/MaximumDuration/SleeperTest.php b/test/EndToEnd/PHPUnit13/Console/Configuration/MaximumDuration/SleeperTest.php new file mode 100644 index 000000000..36f01d2f1 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/Configuration/MaximumDuration/SleeperTest.php @@ -0,0 +1,60 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 1200, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit13/Console/Configuration/MaximumDuration/phpunit.xml b/test/EndToEnd/PHPUnit13/Console/Configuration/MaximumDuration/phpunit.xml new file mode 100644 index 000000000..0df6a31f9 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/Configuration/MaximumDuration/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit13/Console/Configuration/MaximumDuration/test.phpt b/test/EndToEnd/PHPUnit13/Console/Configuration/MaximumDuration/test.phpt new file mode 100644 index 000000000..d94cbf9ae --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/Configuration/MaximumDuration/test.phpt @@ -0,0 +1,43 @@ +--TEST-- +With custom configuration setting the "maximum-duration" parameter in the XML configuration file +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +............ 12 / 12 (100%) + +Detected 11 tests where the duration exceeded the global maximum duration (0.100). + + # Duration Test +---------%s + 1 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(1200) + 2 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(1100) + 3 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(1000) + 4 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(900) + 5 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(800) + 6 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(700) + 7 0.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(600) + 8 0.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(500) + 9 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(400) +10 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\MaximumDuration\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +---------%s + 0.000 + └─── seconds + +There is 1 additional slow test that is not listed here. + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit13/Console/Configuration/Stderr/SleeperTest.php b/test/EndToEnd/PHPUnit13/Console/Configuration/Stderr/SleeperTest.php new file mode 100644 index 000000000..eaccd18a0 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/Configuration/Stderr/SleeperTest.php @@ -0,0 +1,60 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] + public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable + { + $values = \range( + 600, + 1600, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit13/Console/Configuration/Stderr/phpunit.xml b/test/EndToEnd/PHPUnit13/Console/Configuration/Stderr/phpunit.xml new file mode 100644 index 000000000..6e56efcab --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/Configuration/Stderr/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit13/Console/Configuration/Stderr/test.phpt b/test/EndToEnd/PHPUnit13/Console/Configuration/Stderr/test.phpt new file mode 100644 index 000000000..fcbe08a26 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/Configuration/Stderr/test.phpt @@ -0,0 +1,43 @@ +--TEST-- +With configuration setting stderr to true +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +............ 12 / 12 (100%) + +Detected 11 tests where the duration exceeded the global maximum duration (0.500). + + # Duration Test +---------%s + 1 1.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1600) + 2 1.5%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1500) + 3 1.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1400) + 4 1.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1300) + 5 1.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1200) + 6 1.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1100) + 7 1.0%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(1000) + 8 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(900) + 9 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(800) +10 0.7%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\Configuration\Stderr\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider%s(700) +---------%s + 0.000 + └─── seconds + +There is 1 additional slow test that is not listed here. + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit13/Console/Option/NoOutput/SleeperTest.php b/test/EndToEnd/PHPUnit13/Console/Option/NoOutput/SleeperTest.php new file mode 100644 index 000000000..e7569ea41 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/Option/NoOutput/SleeperTest.php @@ -0,0 +1,32 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit13/Console/Option/NoOutput/phpunit.xml b/test/EndToEnd/PHPUnit13/Console/Option/NoOutput/phpunit.xml new file mode 100644 index 000000000..3ffe6387a --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/Option/NoOutput/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit13/Console/Option/NoOutput/test.phpt b/test/EndToEnd/PHPUnit13/Console/Option/NoOutput/test.phpt new file mode 100644 index 000000000..b1065a505 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/Option/NoOutput/test.phpt @@ -0,0 +1,18 @@ +--TEST-- +With default configuration of extension +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/Bare/SleeperTest.php b/test/EndToEnd/PHPUnit13/Console/TestCase/Bare/SleeperTest.php new file mode 100644 index 000000000..6426fcd6e --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/Bare/SleeperTest.php @@ -0,0 +1,60 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/Bare/phpunit.xml b/test/EndToEnd/PHPUnit13/Console/TestCase/Bare/phpunit.xml new file mode 100644 index 000000000..3ffe6387a --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/Bare/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/Bare/test.phpt b/test/EndToEnd/PHPUnit13/Console/TestCase/Bare/test.phpt new file mode 100644 index 000000000..6bf39d1ab --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/Bare/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that does not sleep in methods that are not test methods +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\Bare\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\Bare\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/Combination/SleeperTest.php b/test/EndToEnd/PHPUnit13/Console/TestCase/Combination/SleeperTest.php new file mode 100644 index 000000000..cf4b6ace4 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/Combination/SleeperTest.php @@ -0,0 +1,116 @@ +sleep(); + } + + public static function tearDownAfterClass(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function setUp(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPreConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPostConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function tearDown(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\Before] + public function sleepWithBeforeAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\BeforeClass] + public static function sleepWithBeforeClassAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\After] + public function sleepWithAfterAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\AfterClass] + public static function sleepWithAfterClassAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/Combination/phpunit.xml b/test/EndToEnd/PHPUnit13/Console/TestCase/Combination/phpunit.xml new file mode 100644 index 000000000..3ffe6387a --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/Combination/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/Combination/test.phpt b/test/EndToEnd/PHPUnit13/Console/TestCase/Combination/test.phpt new file mode 100644 index 000000000..c2410215f --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/Combination/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in data provider, hook, and test methods +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\Combination\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\Combination\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +3 0.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\Combination\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithAfterAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAfterAttribute/SleeperTest.php new file mode 100644 index 000000000..8ef2f9a6c --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAfterAttribute/SleeperTest.php @@ -0,0 +1,66 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithAfterAttribute/phpunit.xml b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAfterAttribute/phpunit.xml new file mode 100644 index 000000000..3ffe6387a --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAfterAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithAfterAttribute/test.phpt b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAfterAttribute/test.phpt new file mode 100644 index 000000000..728efbfa6 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAfterAttribute/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in a method with After attribute +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithAfterClassAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAfterClassAttribute/SleeperTest.php new file mode 100644 index 000000000..4c2e5f0f3 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAfterClassAttribute/SleeperTest.php @@ -0,0 +1,66 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithAfterClassAttribute/phpunit.xml b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAfterClassAttribute/phpunit.xml new file mode 100644 index 000000000..3ffe6387a --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAfterClassAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithAfterClassAttribute/test.phpt b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAfterClassAttribute/test.phpt new file mode 100644 index 000000000..ac0c4a25b --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAfterClassAttribute/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a method with AfterClass attribute +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithAfterClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithAfterClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithAssertPostConditions/SleeperTest.php b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAssertPostConditions/SleeperTest.php new file mode 100644 index 000000000..5d65597e6 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAssertPostConditions/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithAssertPostConditions/phpunit.xml b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAssertPostConditions/phpunit.xml new file mode 100644 index 000000000..3ffe6387a --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAssertPostConditions/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithAssertPostConditions/test.phpt b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAssertPostConditions/test.phpt new file mode 100644 index 000000000..257418a94 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAssertPostConditions/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in assertPostConditions() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithAssertPreConditions/SleeperTest.php b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAssertPreConditions/SleeperTest.php new file mode 100644 index 000000000..840b140f6 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAssertPreConditions/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithAssertPreConditions/phpunit.xml b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAssertPreConditions/phpunit.xml new file mode 100644 index 000000000..3ffe6387a --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAssertPreConditions/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithAssertPreConditions/test.phpt b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAssertPreConditions/test.phpt new file mode 100644 index 000000000..3293da136 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithAssertPreConditions/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in assertPreConditions() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithBeforeAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit13/Console/TestCase/WithBeforeAttribute/SleeperTest.php new file mode 100644 index 000000000..3f626ac1d --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithBeforeAttribute/SleeperTest.php @@ -0,0 +1,66 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithBeforeAttribute/phpunit.xml b/test/EndToEnd/PHPUnit13/Console/TestCase/WithBeforeAttribute/phpunit.xml new file mode 100644 index 000000000..3ffe6387a --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithBeforeAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithBeforeAttribute/test.phpt b/test/EndToEnd/PHPUnit13/Console/TestCase/WithBeforeAttribute/test.phpt new file mode 100644 index 000000000..4cde1472f --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithBeforeAttribute/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in a method with Before attribute +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithBeforeClassAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit13/Console/TestCase/WithBeforeClassAttribute/SleeperTest.php new file mode 100644 index 000000000..5b842819b --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithBeforeClassAttribute/SleeperTest.php @@ -0,0 +1,66 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithBeforeClassAttribute/phpunit.xml b/test/EndToEnd/PHPUnit13/Console/TestCase/WithBeforeClassAttribute/phpunit.xml new file mode 100644 index 000000000..3ffe6387a --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithBeforeClassAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithBeforeClassAttribute/test.phpt b/test/EndToEnd/PHPUnit13/Console/TestCase/WithBeforeClassAttribute/test.phpt new file mode 100644 index 000000000..fa6ee09cc --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithBeforeClassAttribute/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a method with BeforeClass attribute +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithBeforeClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithBeforeClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithDataProvider/SleeperTest.php b/test/EndToEnd/PHPUnit13/Console/TestCase/WithDataProvider/SleeperTest.php new file mode 100644 index 000000000..21c8c98d0 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithDataProvider/SleeperTest.php @@ -0,0 +1,62 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithDataProvider/phpunit.xml b/test/EndToEnd/PHPUnit13/Console/TestCase/WithDataProvider/phpunit.xml new file mode 100644 index 000000000..3ffe6387a --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithDataProvider/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithDataProvider/test.phpt b/test/EndToEnd/PHPUnit13/Console/TestCase/WithDataProvider/test.phpt new file mode 100644 index 000000000..65da75e26 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithDataProvider/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a data provider +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithDataProvider\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithDataProvider\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithSetUp/SleeperTest.php b/test/EndToEnd/PHPUnit13/Console/TestCase/WithSetUp/SleeperTest.php new file mode 100644 index 000000000..313b266b2 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithSetUp/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithSetUp/phpunit.xml b/test/EndToEnd/PHPUnit13/Console/TestCase/WithSetUp/phpunit.xml new file mode 100644 index 000000000..3ffe6387a --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithSetUp/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithSetUp/test.phpt b/test/EndToEnd/PHPUnit13/Console/TestCase/WithSetUp/test.phpt new file mode 100644 index 000000000..440644fa6 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithSetUp/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in a setUp() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithSetUpBeforeClass/SleeperTest.php b/test/EndToEnd/PHPUnit13/Console/TestCase/WithSetUpBeforeClass/SleeperTest.php new file mode 100644 index 000000000..b1d3add95 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithSetUpBeforeClass/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithSetUpBeforeClass/phpunit.xml b/test/EndToEnd/PHPUnit13/Console/TestCase/WithSetUpBeforeClass/phpunit.xml new file mode 100644 index 000000000..3ffe6387a --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithSetUpBeforeClass/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithSetUpBeforeClass/test.phpt b/test/EndToEnd/PHPUnit13/Console/TestCase/WithSetUpBeforeClass/test.phpt new file mode 100644 index 000000000..70e15f5da --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithSetUpBeforeClass/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a setUpBeforeClass() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithSetUpBeforeClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithSetUpBeforeClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithTearDown/SleeperTest.php b/test/EndToEnd/PHPUnit13/Console/TestCase/WithTearDown/SleeperTest.php new file mode 100644 index 000000000..d4c08c2f8 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithTearDown/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithTearDown/phpunit.xml b/test/EndToEnd/PHPUnit13/Console/TestCase/WithTearDown/phpunit.xml new file mode 100644 index 000000000..3ffe6387a --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithTearDown/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithTearDown/test.phpt b/test/EndToEnd/PHPUnit13/Console/TestCase/WithTearDown/test.phpt new file mode 100644 index 000000000..abe3f1bc8 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithTearDown/test.phpt @@ -0,0 +1,34 @@ +--TEST-- +With a test case that sleeps in a tearDown() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 3 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithTearDownAfterClass/SleeperTest.php b/test/EndToEnd/PHPUnit13/Console/TestCase/WithTearDownAfterClass/SleeperTest.php new file mode 100644 index 000000000..8532ef68a --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithTearDownAfterClass/SleeperTest.php @@ -0,0 +1,65 @@ +sleep(); + } + + public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void + { + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + /** + * @return \Generator + */ + public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable + { + $values = \range( + 200, + 300, + 100 + ); + + foreach ($values as $value) { + yield $value => [ + $value, + ]; + } + } +} diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithTearDownAfterClass/phpunit.xml b/test/EndToEnd/PHPUnit13/Console/TestCase/WithTearDownAfterClass/phpunit.xml new file mode 100644 index 000000000..3ffe6387a --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithTearDownAfterClass/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithTearDownAfterClass/test.phpt b/test/EndToEnd/PHPUnit13/Console/TestCase/WithTearDownAfterClass/test.phpt new file mode 100644 index 000000000..5c4be7738 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithTearDownAfterClass/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With a test case that sleeps in a tearDownAfterClass() method +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +... 3 / 3 (100%) + +Detected 2 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +---------%s +1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithTearDownAfterClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) +2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithTearDownAfterClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) +---------%s + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithoutTestMethods/SleeperTest.php b/test/EndToEnd/PHPUnit13/Console/TestCase/WithoutTestMethods/SleeperTest.php new file mode 100644 index 000000000..99f173a19 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithoutTestMethods/SleeperTest.php @@ -0,0 +1,22 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit13/Console/TestCase/WithoutTestMethods/test.phpt b/test/EndToEnd/PHPUnit13/Console/TestCase/WithoutTestMethods/test.phpt new file mode 100644 index 000000000..25ae7a65c --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestCase/WithoutTestMethods/test.phpt @@ -0,0 +1,24 @@ +--TEST-- +With a test case that has no test methods +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +There was 1 PHPUnit test runner warning: + +1) No tests found in class "Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestCase\WithoutTestMethods\SleeperTest". + +No tests executed! diff --git a/test/EndToEnd/PHPUnit13/Console/TestMethod/WithMaximumDurationAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit13/Console/TestMethod/WithMaximumDurationAttribute/SleeperTest.php new file mode 100644 index 000000000..a00a5289e --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestMethod/WithMaximumDurationAttribute/SleeperTest.php @@ -0,0 +1,46 @@ +sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Attribute\MaximumDuration(200)] + public function testSleeperSleepsLongerThanMaximumDurationFromAttributeWhenTestMethodHasValidMaximumDurationAttribute(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit13/Console/TestMethod/WithMaximumDurationAttribute/phpunit.xml b/test/EndToEnd/PHPUnit13/Console/TestMethod/WithMaximumDurationAttribute/phpunit.xml new file mode 100644 index 000000000..3ffe6387a --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestMethod/WithMaximumDurationAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit13/Console/TestMethod/WithMaximumDurationAttribute/test.phpt b/test/EndToEnd/PHPUnit13/Console/TestMethod/WithMaximumDurationAttribute/test.phpt new file mode 100644 index 000000000..ab8dca3aa --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestMethod/WithMaximumDurationAttribute/test.phpt @@ -0,0 +1,33 @@ +--TEST-- +With test methods with @maximumDuration Attributes +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +.. 2 / 2 (100%) + +Detected 1 test where the duration exceeded a custom or the global maximum duration (0.100). + +# Duration Test + Actual Maximum +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestMethod\WithMaximumDurationAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromAttributeWhenTestMethodHasValidMaximumDurationAttribute +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit13/Console/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit13/Console/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php new file mode 100644 index 000000000..68c0a9921 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php @@ -0,0 +1,121 @@ +sleep(); + } + + public static function tearDownAfterClass(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function setUp(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPreConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function assertPostConditions(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + protected function tearDown(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\Before] + public function sleepWithBeforeAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\BeforeClass] + public static function sleepWithBeforeClassAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\After] + public function sleepWithAfterAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + #[Framework\Attributes\AfterClass] + public static function sleepWithAfterClassAttribute(): void + { + Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); + } + + public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 50; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\RunInSeparateProcess] + public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute(): void + { + $milliseconds = 10; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration(): void + { + $milliseconds = 200; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } + + #[Framework\Attributes\RunInSeparateProcess] + public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute(): void + { + $milliseconds = 300; + + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + + $sleeper->sleep(); + + self::assertSame($milliseconds, $sleeper->milliseconds()); + } +} diff --git a/test/EndToEnd/PHPUnit13/Console/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml b/test/EndToEnd/PHPUnit13/Console/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml new file mode 100644 index 000000000..3ffe6387a --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml @@ -0,0 +1,33 @@ + + + + + + + + + . + + + diff --git a/test/EndToEnd/PHPUnit13/Console/TestMethod/WithRunInSeparateProcessAttribute/test.phpt b/test/EndToEnd/PHPUnit13/Console/TestMethod/WithRunInSeparateProcessAttribute/test.phpt new file mode 100644 index 000000000..4a581e8c0 --- /dev/null +++ b/test/EndToEnd/PHPUnit13/Console/TestMethod/WithRunInSeparateProcessAttribute/test.phpt @@ -0,0 +1,40 @@ +--TEST-- +With a test case that sleeps in data provider, hook, and test methods and has test methods with RunInSeparateProcess attribute +--FILE-- +run($_SERVER['argv']); +--EXPECTF-- +%a + +.... 4 / 4 (100%) + +Detected 4 tests where the duration exceeded the global maximum duration (0.100). + +# Duration Test +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +1 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute +2 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute +3 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration +4 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\Console\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + 0.000 + └─── seconds + +Time: %s +%a diff --git a/test/EndToEnd/PHPUnit13/Option/NoOutput/SleeperTest.php b/test/EndToEnd/PHPUnit13/Option/NoOutput/SleeperTest.php deleted file mode 100644 index 368d2312d..000000000 --- a/test/EndToEnd/PHPUnit13/Option/NoOutput/SleeperTest.php +++ /dev/null @@ -1,32 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit13/Option/NoOutput/phpunit.xml b/test/EndToEnd/PHPUnit13/Option/NoOutput/phpunit.xml deleted file mode 100644 index fdf2e3d37..000000000 --- a/test/EndToEnd/PHPUnit13/Option/NoOutput/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit13/Option/NoOutput/test.phpt b/test/EndToEnd/PHPUnit13/Option/NoOutput/test.phpt deleted file mode 100644 index 9f1fd9d8a..000000000 --- a/test/EndToEnd/PHPUnit13/Option/NoOutput/test.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -With default configuration of extension ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- diff --git a/test/EndToEnd/PHPUnit13/TestCase/Bare/SleeperTest.php b/test/EndToEnd/PHPUnit13/TestCase/Bare/SleeperTest.php deleted file mode 100644 index 2ef8b886b..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/Bare/SleeperTest.php +++ /dev/null @@ -1,60 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit13/TestCase/Bare/phpunit.xml b/test/EndToEnd/PHPUnit13/TestCase/Bare/phpunit.xml deleted file mode 100644 index fdf2e3d37..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/Bare/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit13/TestCase/Bare/test.phpt b/test/EndToEnd/PHPUnit13/TestCase/Bare/test.phpt deleted file mode 100644 index a3a455775..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/Bare/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that does not sleep in methods that are not test methods ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\Bare\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\Bare\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit13/TestCase/Combination/SleeperTest.php b/test/EndToEnd/PHPUnit13/TestCase/Combination/SleeperTest.php deleted file mode 100644 index b4d1d8d9f..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/Combination/SleeperTest.php +++ /dev/null @@ -1,116 +0,0 @@ -sleep(); - } - - public static function tearDownAfterClass(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function setUp(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPreConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPostConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function tearDown(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\Before] - public function sleepWithBeforeAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\BeforeClass] - public static function sleepWithBeforeClassAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\After] - public function sleepWithAfterAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\AfterClass] - public static function sleepWithAfterClassAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit13/TestCase/Combination/phpunit.xml b/test/EndToEnd/PHPUnit13/TestCase/Combination/phpunit.xml deleted file mode 100644 index fdf2e3d37..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/Combination/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit13/TestCase/Combination/test.phpt b/test/EndToEnd/PHPUnit13/TestCase/Combination/test.phpt deleted file mode 100644 index 028517156..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/Combination/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in data provider, hook, and test methods ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.9%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\Combination\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.8%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\Combination\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) -3 0.6%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\Combination\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithAfterAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit13/TestCase/WithAfterAttribute/SleeperTest.php deleted file mode 100644 index a0aa90805..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithAfterAttribute/SleeperTest.php +++ /dev/null @@ -1,66 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithAfterAttribute/phpunit.xml b/test/EndToEnd/PHPUnit13/TestCase/WithAfterAttribute/phpunit.xml deleted file mode 100644 index fdf2e3d37..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithAfterAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithAfterAttribute/test.phpt b/test/EndToEnd/PHPUnit13/TestCase/WithAfterAttribute/test.phpt deleted file mode 100644 index c1bae00f5..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithAfterAttribute/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with After attribute ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithAfterAttribute\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithAfterClassAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit13/TestCase/WithAfterClassAttribute/SleeperTest.php deleted file mode 100644 index fc5853b2c..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithAfterClassAttribute/SleeperTest.php +++ /dev/null @@ -1,66 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithAfterClassAttribute/phpunit.xml b/test/EndToEnd/PHPUnit13/TestCase/WithAfterClassAttribute/phpunit.xml deleted file mode 100644 index fdf2e3d37..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithAfterClassAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithAfterClassAttribute/test.phpt b/test/EndToEnd/PHPUnit13/TestCase/WithAfterClassAttribute/test.phpt deleted file mode 100644 index a77840108..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithAfterClassAttribute/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with AfterClass attribute ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithAfterClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithAfterClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithAssertPostConditions/SleeperTest.php b/test/EndToEnd/PHPUnit13/TestCase/WithAssertPostConditions/SleeperTest.php deleted file mode 100644 index ce35e5e14..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithAssertPostConditions/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithAssertPostConditions/phpunit.xml b/test/EndToEnd/PHPUnit13/TestCase/WithAssertPostConditions/phpunit.xml deleted file mode 100644 index fdf2e3d37..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithAssertPostConditions/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithAssertPostConditions/test.phpt b/test/EndToEnd/PHPUnit13/TestCase/WithAssertPostConditions/test.phpt deleted file mode 100644 index eeca2e0da..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithAssertPostConditions/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in assertPostConditions() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithAssertPostConditions\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithAssertPreConditions/SleeperTest.php b/test/EndToEnd/PHPUnit13/TestCase/WithAssertPreConditions/SleeperTest.php deleted file mode 100644 index 015ccc6b6..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithAssertPreConditions/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithAssertPreConditions/phpunit.xml b/test/EndToEnd/PHPUnit13/TestCase/WithAssertPreConditions/phpunit.xml deleted file mode 100644 index fdf2e3d37..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithAssertPreConditions/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithAssertPreConditions/test.phpt b/test/EndToEnd/PHPUnit13/TestCase/WithAssertPreConditions/test.phpt deleted file mode 100644 index fb725962b..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithAssertPreConditions/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in assertPreConditions() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithAssertPreConditions\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithBeforeAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit13/TestCase/WithBeforeAttribute/SleeperTest.php deleted file mode 100644 index 841191aae..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithBeforeAttribute/SleeperTest.php +++ /dev/null @@ -1,66 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithBeforeAttribute/phpunit.xml b/test/EndToEnd/PHPUnit13/TestCase/WithBeforeAttribute/phpunit.xml deleted file mode 100644 index fdf2e3d37..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithBeforeAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithBeforeAttribute/test.phpt b/test/EndToEnd/PHPUnit13/TestCase/WithBeforeAttribute/test.phpt deleted file mode 100644 index c3e19048e..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithBeforeAttribute/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with Before attribute ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithBeforeAttribute\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithBeforeClassAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit13/TestCase/WithBeforeClassAttribute/SleeperTest.php deleted file mode 100644 index c502f8280..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithBeforeClassAttribute/SleeperTest.php +++ /dev/null @@ -1,66 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithBeforeClassAttribute/phpunit.xml b/test/EndToEnd/PHPUnit13/TestCase/WithBeforeClassAttribute/phpunit.xml deleted file mode 100644 index fdf2e3d37..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithBeforeClassAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithBeforeClassAttribute/test.phpt b/test/EndToEnd/PHPUnit13/TestCase/WithBeforeClassAttribute/test.phpt deleted file mode 100644 index cc6682808..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithBeforeClassAttribute/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a method with BeforeClass attribute ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithBeforeClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithBeforeClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithDataProvider/SleeperTest.php b/test/EndToEnd/PHPUnit13/TestCase/WithDataProvider/SleeperTest.php deleted file mode 100644 index c12581f34..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithDataProvider/SleeperTest.php +++ /dev/null @@ -1,62 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithDataProvider/phpunit.xml b/test/EndToEnd/PHPUnit13/TestCase/WithDataProvider/phpunit.xml deleted file mode 100644 index fdf2e3d37..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithDataProvider/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithDataProvider/test.phpt b/test/EndToEnd/PHPUnit13/TestCase/WithDataProvider/test.phpt deleted file mode 100644 index 6d4e57230..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithDataProvider/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a data provider ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithDataProvider\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithDataProvider\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithSetUp/SleeperTest.php b/test/EndToEnd/PHPUnit13/TestCase/WithSetUp/SleeperTest.php deleted file mode 100644 index d1f280689..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithSetUp/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithSetUp/phpunit.xml b/test/EndToEnd/PHPUnit13/TestCase/WithSetUp/phpunit.xml deleted file mode 100644 index fdf2e3d37..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithSetUp/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithSetUp/test.phpt b/test/EndToEnd/PHPUnit13/TestCase/WithSetUp/test.phpt deleted file mode 100644 index 8955b77ad..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithSetUp/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in a setUp() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithSetUp\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithSetUpBeforeClass/SleeperTest.php b/test/EndToEnd/PHPUnit13/TestCase/WithSetUpBeforeClass/SleeperTest.php deleted file mode 100644 index 2dd9be591..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithSetUpBeforeClass/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithSetUpBeforeClass/phpunit.xml b/test/EndToEnd/PHPUnit13/TestCase/WithSetUpBeforeClass/phpunit.xml deleted file mode 100644 index fdf2e3d37..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithSetUpBeforeClass/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithSetUpBeforeClass/test.phpt b/test/EndToEnd/PHPUnit13/TestCase/WithSetUpBeforeClass/test.phpt deleted file mode 100644 index 1b7af5821..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithSetUpBeforeClass/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a setUpBeforeClass() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithSetUpBeforeClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithSetUpBeforeClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithTearDown/SleeperTest.php b/test/EndToEnd/PHPUnit13/TestCase/WithTearDown/SleeperTest.php deleted file mode 100644 index 78d390afd..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithTearDown/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithTearDown/phpunit.xml b/test/EndToEnd/PHPUnit13/TestCase/WithTearDown/phpunit.xml deleted file mode 100644 index fdf2e3d37..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithTearDown/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithTearDown/test.phpt b/test/EndToEnd/PHPUnit13/TestCase/WithTearDown/test.phpt deleted file mode 100644 index f94d92d4b..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithTearDown/test.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -With a test case that sleeps in a tearDown() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 3 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.4%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) -3 0.1%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithTearDown\SleeperTest::testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithTearDownAfterClass/SleeperTest.php b/test/EndToEnd/PHPUnit13/TestCase/WithTearDownAfterClass/SleeperTest.php deleted file mode 100644 index 462e1c4cd..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithTearDownAfterClass/SleeperTest.php +++ /dev/null @@ -1,65 +0,0 @@ -sleep(); - } - - public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void - { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @return \Generator - */ - public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable - { - $values = \range( - 200, - 300, - 100 - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithTearDownAfterClass/phpunit.xml b/test/EndToEnd/PHPUnit13/TestCase/WithTearDownAfterClass/phpunit.xml deleted file mode 100644 index fdf2e3d37..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithTearDownAfterClass/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithTearDownAfterClass/test.phpt b/test/EndToEnd/PHPUnit13/TestCase/WithTearDownAfterClass/test.phpt deleted file mode 100644 index e9b6f372c..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithTearDownAfterClass/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With a test case that sleeps in a tearDownAfterClass() method ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -... 3 / 3 (100%) - -Detected 2 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------%s -1 0.3%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithTearDownAfterClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(300) -2 0.2%s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithTearDownAfterClass\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider%s(200) ----------%s - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithoutTestMethods/SleeperTest.php b/test/EndToEnd/PHPUnit13/TestCase/WithoutTestMethods/SleeperTest.php deleted file mode 100644 index 4b829fca1..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithoutTestMethods/SleeperTest.php +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit13/TestCase/WithoutTestMethods/test.phpt b/test/EndToEnd/PHPUnit13/TestCase/WithoutTestMethods/test.phpt deleted file mode 100644 index ed046e3f2..000000000 --- a/test/EndToEnd/PHPUnit13/TestCase/WithoutTestMethods/test.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -With a test case that has no test methods ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -There was 1 PHPUnit test runner warning: - -1) No tests found in class "Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestCase\WithoutTestMethods\SleeperTest". - -No tests executed! diff --git a/test/EndToEnd/PHPUnit13/TestMethod/WithMaximumDurationAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit13/TestMethod/WithMaximumDurationAttribute/SleeperTest.php deleted file mode 100644 index 25b1b32ea..000000000 --- a/test/EndToEnd/PHPUnit13/TestMethod/WithMaximumDurationAttribute/SleeperTest.php +++ /dev/null @@ -1,46 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Attribute\MaximumDuration(200)] - public function testSleeperSleepsLongerThanMaximumDurationFromAttributeWhenTestMethodHasValidMaximumDurationAttribute(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit13/TestMethod/WithMaximumDurationAttribute/phpunit.xml b/test/EndToEnd/PHPUnit13/TestMethod/WithMaximumDurationAttribute/phpunit.xml deleted file mode 100644 index fdf2e3d37..000000000 --- a/test/EndToEnd/PHPUnit13/TestMethod/WithMaximumDurationAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit13/TestMethod/WithMaximumDurationAttribute/test.phpt b/test/EndToEnd/PHPUnit13/TestMethod/WithMaximumDurationAttribute/test.phpt deleted file mode 100644 index 107697311..000000000 --- a/test/EndToEnd/PHPUnit13/TestMethod/WithMaximumDurationAttribute/test.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -With test methods with @maximumDuration Attributes ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -.. 2 / 2 (100%) - -Detected 1 test where the duration exceeded a custom or the global maximum duration (0.100). - -# Duration Test - Actual Maximum ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 0.3%s 0.200 Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestMethod\WithMaximumDurationAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromAttributeWhenTestMethodHasValidMaximumDurationAttribute ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/EndToEnd/PHPUnit13/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php b/test/EndToEnd/PHPUnit13/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php deleted file mode 100644 index cb0eb8744..000000000 --- a/test/EndToEnd/PHPUnit13/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php +++ /dev/null @@ -1,121 +0,0 @@ -sleep(); - } - - public static function tearDownAfterClass(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function setUp(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPreConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function assertPostConditions(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - protected function tearDown(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\Before] - public function sleepWithBeforeAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\BeforeClass] - public static function sleepWithBeforeClassAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\After] - public function sleepWithAfterAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - #[Framework\Attributes\AfterClass] - public static function sleepWithAfterClassAttribute(): void - { - Test\Fixture\Sleeper::fromMilliseconds(100)->sleep(); - } - - public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 50; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\RunInSeparateProcess] - public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute(): void - { - $milliseconds = 10; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration(): void - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - #[Framework\Attributes\RunInSeparateProcess] - public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute(): void - { - $milliseconds = 300; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/PHPUnit13/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml b/test/EndToEnd/PHPUnit13/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml deleted file mode 100644 index fdf2e3d37..000000000 --- a/test/EndToEnd/PHPUnit13/TestMethod/WithRunInSeparateProcessAttribute/phpunit.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - . - - - diff --git a/test/EndToEnd/PHPUnit13/TestMethod/WithRunInSeparateProcessAttribute/test.phpt b/test/EndToEnd/PHPUnit13/TestMethod/WithRunInSeparateProcessAttribute/test.phpt deleted file mode 100644 index 36b00eb78..000000000 --- a/test/EndToEnd/PHPUnit13/TestMethod/WithRunInSeparateProcessAttribute/test.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -With a test case that sleeps in data provider, hook, and test methods and has test methods with RunInSeparateProcess attribute ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -%a - -.... 4 / 4 (100%) - -Detected 4 tests where the duration exceeded the global maximum duration (0.100). - -# Duration Test ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -1 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute -2 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAttribute -3 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration -4 %s Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\PHPUnit13\TestMethod\WithRunInSeparateProcessAttribute\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - 0.000 - └─── seconds - -Time: %s -%a diff --git a/test/Unit/Reporter/ColorTest.php b/test/Unit/Reporter/Console/ColorTest.php similarity index 77% rename from test/Unit/Reporter/ColorTest.php rename to test/Unit/Reporter/Console/ColorTest.php index d5a79e903..c8b86f265 100644 --- a/test/Unit/Reporter/ColorTest.php +++ b/test/Unit/Reporter/Console/ColorTest.php @@ -11,14 +11,14 @@ * @see https://github.com/ergebnis/phpunit-slow-test-detector */ -namespace Ergebnis\PHPUnit\SlowTestDetector\Test\Unit\Reporter; +namespace Ergebnis\PHPUnit\SlowTestDetector\Test\Unit\Reporter\Console; use Ergebnis\PHPUnit\SlowTestDetector\Reporter; use Ergebnis\PHPUnit\SlowTestDetector\Test; use PHPUnit\Framework; /** - * @covers \Ergebnis\PHPUnit\SlowTestDetector\Reporter\Color + * @covers \Ergebnis\PHPUnit\SlowTestDetector\Reporter\Console\Color */ final class ColorTest extends Framework\TestCase { @@ -30,7 +30,7 @@ final class ColorTest extends Framework\TestCase */ public function testDimReturnsOriginalStringWhenItIsWhitespaceOnly(string $output) { - self::assertSame($output, Reporter\Color::dim($output)); + self::assertSame($output, Reporter\Console\Color::dim($output)); } public function testDimReturnsDimmedStringWhenItIsNotWhitespaceOnly() @@ -42,6 +42,6 @@ public function testDimReturnsDimmedStringWhenItIsNotWhitespaceOnly() $output ); - self::assertSame($expected, Reporter\Color::dim($output)); + self::assertSame($expected, Reporter\Console\Color::dim($output)); } } diff --git a/test/Unit/Reporter/ConsoleReporterTest.php b/test/Unit/Reporter/Console/ConsoleReporterTest.php similarity index 97% rename from test/Unit/Reporter/ConsoleReporterTest.php rename to test/Unit/Reporter/Console/ConsoleReporterTest.php index 4eb8cac45..1a2057074 100644 --- a/test/Unit/Reporter/ConsoleReporterTest.php +++ b/test/Unit/Reporter/Console/ConsoleReporterTest.php @@ -11,7 +11,7 @@ * @see https://github.com/ergebnis/phpunit-slow-test-detector */ -namespace Ergebnis\PHPUnit\SlowTestDetector\Test\Unit\Reporter; +namespace Ergebnis\PHPUnit\SlowTestDetector\Test\Unit\Reporter\Console; use Ergebnis\PHPUnit\SlowTestDetector\Count; use Ergebnis\PHPUnit\SlowTestDetector\Duration; @@ -26,15 +26,15 @@ use PHPUnit\Framework; /** - * @covers \Ergebnis\PHPUnit\SlowTestDetector\Reporter\ConsoleReporter + * @covers \Ergebnis\PHPUnit\SlowTestDetector\Reporter\Console\ConsoleReporter * * @uses \Ergebnis\PHPUnit\SlowTestDetector\Comparator\DurationComparator * @uses \Ergebnis\PHPUnit\SlowTestDetector\Count * @uses \Ergebnis\PHPUnit\SlowTestDetector\Duration * @uses \Ergebnis\PHPUnit\SlowTestDetector\MaximumCount * @uses \Ergebnis\PHPUnit\SlowTestDetector\MaximumDuration - * @uses \Ergebnis\PHPUnit\SlowTestDetector\Reporter\Formatter\DefaultDurationFormatter - * @uses \Ergebnis\PHPUnit\SlowTestDetector\Reporter\Formatter\Unit + * @uses \Ergebnis\PHPUnit\SlowTestDetector\Reporter\Console\DefaultDurationFormatter + * @uses \Ergebnis\PHPUnit\SlowTestDetector\Reporter\Console\Unit * @uses \Ergebnis\PHPUnit\SlowTestDetector\SlowTest * @uses \Ergebnis\PHPUnit\SlowTestDetector\SlowTestList * @uses \Ergebnis\PHPUnit\SlowTestDetector\TestDescription @@ -50,8 +50,8 @@ public function testReportReturnsEmptyStringWhenSlowTestListIsEmpty() $slowTestList = SlowTestList::create(); - $reporter = new Reporter\ConsoleReporter( - new Reporter\Formatter\DefaultDurationFormatter(), + $reporter = new Reporter\Console\ConsoleReporter( + new Reporter\Console\DefaultDurationFormatter(), MaximumDuration::default(), MaximumCount::fromCount(Count::fromInt($faker->numberBetween(1))) ); @@ -70,8 +70,8 @@ public function testReportReturnsReportWhenSlowTestListHasFewerSlowTestsThanMaxi MaximumCount $maximumCount, SlowTestList $slowTestList ) { - $reporter = new Reporter\ConsoleReporter( - new Reporter\Formatter\DefaultDurationFormatter(), + $reporter = new Reporter\Console\ConsoleReporter( + new Reporter\Console\DefaultDurationFormatter(), $maximumDuration, $maximumCount ); diff --git a/test/Unit/Reporter/Formatter/DefaultDurationFormatterTest.php b/test/Unit/Reporter/Console/DefaultDurationFormatterTest.php similarity index 78% rename from test/Unit/Reporter/Formatter/DefaultDurationFormatterTest.php rename to test/Unit/Reporter/Console/DefaultDurationFormatterTest.php index 4e0d4ebf7..06d405efa 100644 --- a/test/Unit/Reporter/Formatter/DefaultDurationFormatterTest.php +++ b/test/Unit/Reporter/Console/DefaultDurationFormatterTest.php @@ -11,17 +11,17 @@ * @see https://github.com/ergebnis/phpunit-slow-test-detector */ -namespace Ergebnis\PHPUnit\SlowTestDetector\Test\Unit\Reporter\Formatter; +namespace Ergebnis\PHPUnit\SlowTestDetector\Test\Unit\Reporter\Console; use Ergebnis\PHPUnit\SlowTestDetector\Duration; use Ergebnis\PHPUnit\SlowTestDetector\Reporter; use PHPUnit\Framework; /** - * @covers \Ergebnis\PHPUnit\SlowTestDetector\Reporter\Formatter\DefaultDurationFormatter + * @covers \Ergebnis\PHPUnit\SlowTestDetector\Reporter\Console\DefaultDurationFormatter * * @uses \Ergebnis\PHPUnit\SlowTestDetector\Duration - * @uses \Ergebnis\PHPUnit\SlowTestDetector\Reporter\Formatter\Unit + * @uses \Ergebnis\PHPUnit\SlowTestDetector\Reporter\Console\Unit */ final class DefaultDurationFormatterTest extends Framework\TestCase { @@ -29,11 +29,11 @@ final class DefaultDurationFormatterTest extends Framework\TestCase * @dataProvider provideDurationUnitAndFormattedDuration */ public function testFormatFormats( - Reporter\Formatter\Unit $unit, + Reporter\Console\Unit $unit, Duration $duration, string $formattedDuration ) { - $formatter = new Reporter\Formatter\DefaultDurationFormatter(); + $formatter = new Reporter\Console\DefaultDurationFormatter(); $formatted = $formatter->format( $unit, @@ -44,13 +44,13 @@ public function testFormatFormats( } /** - * @return \Generator + * @return \Generator */ public static function provideDurationUnitAndFormattedDuration(): iterable { $values = [ 'seconds-zero' => [ - Reporter\Formatter\Unit::seconds(), + Reporter\Console\Unit::seconds(), Duration::fromSecondsAndNanoseconds( 0, 0 @@ -58,7 +58,7 @@ public static function provideDurationUnitAndFormattedDuration(): iterable '0.000', ], 'seconds-milliseconds' => [ - Reporter\Formatter\Unit::seconds(), + Reporter\Console\Unit::seconds(), Duration::fromSecondsAndNanoseconds( 0, 123999000 @@ -66,7 +66,7 @@ public static function provideDurationUnitAndFormattedDuration(): iterable '0.123', ], 'seconds-digits-one' => [ - Reporter\Formatter\Unit::seconds(), + Reporter\Console\Unit::seconds(), Duration::fromSecondsAndNanoseconds( 1, 234456789 @@ -74,7 +74,7 @@ public static function provideDurationUnitAndFormattedDuration(): iterable '1.234', ], 'seconds-digits-two' => [ - Reporter\Formatter\Unit::seconds(), + Reporter\Console\Unit::seconds(), Duration::fromSecondsAndNanoseconds( 12, 345678912 @@ -82,7 +82,7 @@ public static function provideDurationUnitAndFormattedDuration(): iterable '12.345', ], 'minutes-zero' => [ - Reporter\Formatter\Unit::minutes(), + Reporter\Console\Unit::minutes(), Duration::fromSecondsAndNanoseconds( 0, 0 @@ -90,7 +90,7 @@ public static function provideDurationUnitAndFormattedDuration(): iterable '0:00.000', ], 'minutes-seconds-only' => [ - Reporter\Formatter\Unit::minutes(), + Reporter\Console\Unit::minutes(), Duration::fromSecondsAndNanoseconds( 12, 345678912 @@ -98,7 +98,7 @@ public static function provideDurationUnitAndFormattedDuration(): iterable '0:12.345', ], 'minutes-digits-one' => [ - Reporter\Formatter\Unit::minutes(), + Reporter\Console\Unit::minutes(), Duration::fromSecondsAndNanoseconds( 1 * 60 + 23, 456789012 @@ -106,7 +106,7 @@ public static function provideDurationUnitAndFormattedDuration(): iterable '1:23.456', ], 'minutes-digits-two' => [ - Reporter\Formatter\Unit::minutes(), + Reporter\Console\Unit::minutes(), Duration::fromSecondsAndNanoseconds( 12 * 60 + 34, 567890123 @@ -114,7 +114,7 @@ public static function provideDurationUnitAndFormattedDuration(): iterable '12:34.567', ], 'hours-zero' => [ - Reporter\Formatter\Unit::hours(), + Reporter\Console\Unit::hours(), Duration::fromSecondsAndNanoseconds( 0, 0 @@ -122,7 +122,7 @@ public static function provideDurationUnitAndFormattedDuration(): iterable '0:00:00.000', ], 'hours-seconds-only' => [ - Reporter\Formatter\Unit::hours(), + Reporter\Console\Unit::hours(), Duration::fromSecondsAndNanoseconds( 12, 345678912 @@ -130,7 +130,7 @@ public static function provideDurationUnitAndFormattedDuration(): iterable '0:00:12.345', ], 'hours-digits-one' => [ - Reporter\Formatter\Unit::hours(), + Reporter\Console\Unit::hours(), Duration::fromSecondsAndNanoseconds( 60 * 60 + 23 * 60 + 45, 567890123 @@ -138,7 +138,7 @@ public static function provideDurationUnitAndFormattedDuration(): iterable '1:23:45.567', ], 'hours-digits-two' => [ - Reporter\Formatter\Unit::hours(), + Reporter\Console\Unit::hours(), Duration::fromSecondsAndNanoseconds( 12 * 60 * 60 + 34 * 60 + 56, 789012345 @@ -146,7 +146,7 @@ public static function provideDurationUnitAndFormattedDuration(): iterable '12:34:56.789', ], 'hours-digits-two-nanoseconds-zero' => [ - Reporter\Formatter\Unit::hours(), + Reporter\Console\Unit::hours(), Duration::fromSecondsAndNanoseconds( 12 * 60 * 60 + 34 * 60 + 56, 00 @@ -154,7 +154,7 @@ public static function provideDurationUnitAndFormattedDuration(): iterable '12:34:56.000', ], 'hours-digits-two-seconds-zero' => [ - Reporter\Formatter\Unit::hours(), + Reporter\Console\Unit::hours(), Duration::fromSecondsAndNanoseconds( 12 * 60 * 60 + 34 * 60, 00 diff --git a/test/Unit/Reporter/Console/UnitTest.php b/test/Unit/Reporter/Console/UnitTest.php new file mode 100644 index 000000000..3344ab50f --- /dev/null +++ b/test/Unit/Reporter/Console/UnitTest.php @@ -0,0 +1,189 @@ +toString()); + } + + public function testMinutesReturnsUnit() + { + $unit = Reporter\Console\Unit::minutes(); + + self::assertSame('minutes', $unit->toString()); + } + + public function testSecondsReturnsUnit() + { + $unit = Reporter\Console\Unit::seconds(); + + self::assertSame('seconds', $unit->toString()); + } + + public function testEqualsReturnsFalseWhenUnitsAreNotEqual() + { + $one = Reporter\Console\Unit::hours(); + $two = Reporter\Console\Unit::minutes(); + + self::assertFalse($one->equals($two)); + } + + public function testEqualsReturnsTrueWhenUnitsAreEqual() + { + $one = Reporter\Console\Unit::hours(); + $two = Reporter\Console\Unit::hours(); + + self::assertTrue($one->equals($two)); + self::assertTrue(Reporter\Console\Unit::minutes()->equals(Reporter\Console\Unit::minutes())); + self::assertTrue(Reporter\Console\Unit::hours()->equals(Reporter\Console\Unit::hours())); + } + + public function testIsGreaterThanReturnsFalseWhenUnitIsNotGreater() + { + $one = Reporter\Console\Unit::minutes(); + $two = Reporter\Console\Unit::hours(); + + self::assertFalse($one->isGreaterThan($two)); + } + + public function testIsGreaterThanReturnsTrueWhenUnitIsGreater() + { + $one = Reporter\Console\Unit::hours(); + $two = Reporter\Console\Unit::minutes(); + + self::assertTrue($one->isGreaterThan($two)); + } + + /** + * @dataProvider provideExpectedUnitAndDuration + */ + public function testFromDurationReturnsExpectedUnit( + Reporter\Console\Unit $expectedUnit, + Duration $duration + ) { + $unit = Reporter\Console\Unit::fromDuration($duration); + + self::assertTrue($expectedUnit->equals($unit)); + } + + /** + * @return \Generator + */ + public static function provideExpectedUnitAndDuration(): iterable + { + $values = [ + 'zero' => [ + Reporter\Console\Unit::seconds(), + Duration::fromMilliseconds(0), + ], + 'milliseconds' => [ + Reporter\Console\Unit::seconds(), + Duration::fromMilliseconds(500), + ], + 'seconds' => [ + Reporter\Console\Unit::seconds(), + Duration::fromMilliseconds(59999), + ], + 'minutes' => [ + Reporter\Console\Unit::minutes(), + Duration::fromMilliseconds(60000), + ], + 'minutes-large' => [ + Reporter\Console\Unit::minutes(), + Duration::fromMilliseconds(3599999), + ], + 'hours' => [ + Reporter\Console\Unit::hours(), + Duration::fromMilliseconds(3600000), + ], + ]; + + foreach ($values as $key => list($expectedUnit, $duration)) { + yield $key => [ + $expectedUnit, + $duration, + ]; + } + } + + /** + * @dataProvider provideExpectedUnitAndDurations + * + * @param list $durations + */ + public function testFromDurationsReturnsLargestUnit( + Reporter\Console\Unit $expectedUnit, + array $durations + ) { + $unit = Reporter\Console\Unit::fromDurations(...$durations); + + self::assertTrue($expectedUnit->equals($unit)); + } + + /** + * @return \Generator}> + */ + public static function provideExpectedUnitAndDurations(): iterable + { + $values = [ + 'all-seconds' => [ + Reporter\Console\Unit::seconds(), + [ + Duration::fromMilliseconds(100), + Duration::fromMilliseconds(200), + ], + ], + 'mixed-seconds-and-minutes' => [ + Reporter\Console\Unit::minutes(), + [ + Duration::fromMilliseconds(100), + Duration::fromMilliseconds(60000), + ], + ], + 'mixed-all' => [ + Reporter\Console\Unit::hours(), + [ + Duration::fromMilliseconds(100), + Duration::fromMilliseconds(60000), + Duration::fromMilliseconds(3600000), + ], + ], + 'empty' => [ + Reporter\Console\Unit::seconds(), + [], + ], + ]; + + foreach ($values as $key => list($expectedUnit, $durations)) { + yield $key => [ + $expectedUnit, + $durations, + ]; + } + } +} diff --git a/test/Unit/Reporter/Formatter/UnitTest.php b/test/Unit/Reporter/Formatter/UnitTest.php deleted file mode 100644 index b78af8c88..000000000 --- a/test/Unit/Reporter/Formatter/UnitTest.php +++ /dev/null @@ -1,189 +0,0 @@ -toString()); - } - - public function testMinutesReturnsUnit() - { - $unit = Reporter\Formatter\Unit::minutes(); - - self::assertSame('minutes', $unit->toString()); - } - - public function testSecondsReturnsUnit() - { - $unit = Reporter\Formatter\Unit::seconds(); - - self::assertSame('seconds', $unit->toString()); - } - - public function testEqualsReturnsFalseWhenUnitsAreNotEqual() - { - $one = Reporter\Formatter\Unit::hours(); - $two = Reporter\Formatter\Unit::minutes(); - - self::assertFalse($one->equals($two)); - } - - public function testEqualsReturnsTrueWhenUnitsAreEqual() - { - $one = Reporter\Formatter\Unit::hours(); - $two = Reporter\Formatter\Unit::hours(); - - self::assertTrue($one->equals($two)); - self::assertTrue(Reporter\Formatter\Unit::minutes()->equals(Reporter\Formatter\Unit::minutes())); - self::assertTrue(Reporter\Formatter\Unit::hours()->equals(Reporter\Formatter\Unit::hours())); - } - - public function testIsGreaterThanReturnsFalseWhenUnitIsNotGreater() - { - $one = Reporter\Formatter\Unit::minutes(); - $two = Reporter\Formatter\Unit::hours(); - - self::assertFalse($one->isGreaterThan($two)); - } - - public function testIsGreaterThanReturnsTrueWhenUnitIsGreater() - { - $one = Reporter\Formatter\Unit::hours(); - $two = Reporter\Formatter\Unit::minutes(); - - self::assertTrue($one->isGreaterThan($two)); - } - - /** - * @dataProvider provideExpectedUnitAndDuration - */ - public function testFromDurationReturnsExpectedUnit( - Reporter\Formatter\Unit $expectedUnit, - Duration $duration - ) { - $unit = Reporter\Formatter\Unit::fromDuration($duration); - - self::assertTrue($expectedUnit->equals($unit)); - } - - /** - * @return \Generator - */ - public static function provideExpectedUnitAndDuration(): iterable - { - $values = [ - 'zero' => [ - Reporter\Formatter\Unit::seconds(), - Duration::fromMilliseconds(0), - ], - 'milliseconds' => [ - Reporter\Formatter\Unit::seconds(), - Duration::fromMilliseconds(500), - ], - 'seconds' => [ - Reporter\Formatter\Unit::seconds(), - Duration::fromMilliseconds(59999), - ], - 'minutes' => [ - Reporter\Formatter\Unit::minutes(), - Duration::fromMilliseconds(60000), - ], - 'minutes-large' => [ - Reporter\Formatter\Unit::minutes(), - Duration::fromMilliseconds(3599999), - ], - 'hours' => [ - Reporter\Formatter\Unit::hours(), - Duration::fromMilliseconds(3600000), - ], - ]; - - foreach ($values as $key => list($expectedUnit, $duration)) { - yield $key => [ - $expectedUnit, - $duration, - ]; - } - } - - /** - * @dataProvider provideExpectedUnitAndDurations - * - * @param list $durations - */ - public function testFromDurationsReturnsLargestUnit( - Reporter\Formatter\Unit $expectedUnit, - array $durations - ) { - $unit = Reporter\Formatter\Unit::fromDurations(...$durations); - - self::assertTrue($expectedUnit->equals($unit)); - } - - /** - * @return \Generator}> - */ - public static function provideExpectedUnitAndDurations(): iterable - { - $values = [ - 'all-seconds' => [ - Reporter\Formatter\Unit::seconds(), - [ - Duration::fromMilliseconds(100), - Duration::fromMilliseconds(200), - ], - ], - 'mixed-seconds-and-minutes' => [ - Reporter\Formatter\Unit::minutes(), - [ - Duration::fromMilliseconds(100), - Duration::fromMilliseconds(60000), - ], - ], - 'mixed-all' => [ - Reporter\Formatter\Unit::hours(), - [ - Duration::fromMilliseconds(100), - Duration::fromMilliseconds(60000), - Duration::fromMilliseconds(3600000), - ], - ], - 'empty' => [ - Reporter\Formatter\Unit::seconds(), - [], - ], - ]; - - foreach ($values as $key => list($expectedUnit, $durations)) { - yield $key => [ - $expectedUnit, - $durations, - ]; - } - } -}