diff --git a/psalm-baseline.xml b/psalm-baseline.xml index ceb968c5..1759238a 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -46,27 +46,12 @@ NullReporter - - - provideMillisecondsGreaterThanDefaultMaximumDuration - - - - - provideMillisecondsGreaterThanDefaultMaximumDuration - - - - - provideMillisecondsGreaterThanDefaultMaximumDuration - - milliseconds * 1000]]> - + provideMillisecondsGreaterThanDefaultMaximumDuration diff --git a/test/EndToEnd/Default/SleeperTest.php b/test/EndToEnd/Default/SleeperTest.php deleted file mode 100644 index 3437ab95..00000000 --- a/test/EndToEnd/Default/SleeperTest.php +++ /dev/null @@ -1,84 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - public function testSleeperSleepsJustBelowDefaultMaximumDuration(): void - { - $milliseconds = 400; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - public function testSleeperSleepsJustAboveDefaultMaximumDuration(): void - { - $milliseconds = 600; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->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(): \Generator - { - $values = \range( - 700, - 1600, - 100, - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/Default/phpunit.xml b/test/EndToEnd/Default/phpunit.xml index d4aee73a..681f1320 100644 --- a/test/EndToEnd/Default/phpunit.xml +++ b/test/EndToEnd/Default/phpunit.xml @@ -25,8 +25,8 @@ - - . + + ../../Fixture/ diff --git a/test/EndToEnd/Default/test.phpt b/test/EndToEnd/Default/test.phpt index 8ae922e7..4457ca26 100644 --- a/test/EndToEnd/Default/test.phpt +++ b/test/EndToEnd/Default/test.phpt @@ -25,16 +25,16 @@ Random Seed: %s Detected 11 tests that took longer than expected. - 1. 1.6%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#9 - 2. 1.5%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#8 - 3. 1.4%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#7 - 4. 1.3%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#6 - 5. 1.2%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#5 - 6. 1.1%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#4 - 7. 1.0%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#3 - 8. 0.9%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#2 - 9. 0.8%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#1 -10. 0.7%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#0 + 1. 1.6%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#9 + 2. 1.5%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#8 + 3. 1.4%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#7 + 4. 1.3%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#6 + 5. 1.2%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#5 + 6. 1.1%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#4 + 7. 1.0%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#3 + 8. 0.9%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#2 + 9. 0.8%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#1 +10. 0.7%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#0 There is 1 additional slow test that is not listed here. diff --git a/test/EndToEnd/MaximumCount/Five/SleeperTest.php b/test/EndToEnd/MaximumCount/Five/SleeperTest.php deleted file mode 100644 index f8bdc166..00000000 --- a/test/EndToEnd/MaximumCount/Five/SleeperTest.php +++ /dev/null @@ -1,84 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - public function testSleeperSleepsBelowDefaultMaximumDuration(): void - { - $milliseconds = 400; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - public function testSleeperSleepsJustAboveDefaultMaximumDuration(): void - { - $milliseconds = 600; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->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(): \Generator - { - $values = \range( - 700, - 1200, - 100, - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/MaximumCount/Five/phpunit.xml b/test/EndToEnd/MaximumCount/Five/phpunit.xml index 5d8a01cb..f7d4f07b 100644 --- a/test/EndToEnd/MaximumCount/Five/phpunit.xml +++ b/test/EndToEnd/MaximumCount/Five/phpunit.xml @@ -21,8 +21,8 @@ - - . + + ../../../Fixture/ diff --git a/test/EndToEnd/MaximumCount/Five/test.phpt b/test/EndToEnd/MaximumCount/Five/test.phpt index 522fec44..40fca2d5 100644 --- a/test/EndToEnd/MaximumCount/Five/test.phpt +++ b/test/EndToEnd/MaximumCount/Five/test.phpt @@ -21,18 +21,18 @@ Runtime: %s Configuration: %Stest/EndToEnd/MaximumCount/Five/phpunit.xml Random Seed: %s -......... 9 / 9 (100%) +............. 13 / 13 (100%) -Detected 7 tests that took longer than expected. +Detected 11 tests that took longer than expected. -1. 1.2%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\MaximumCount\Five\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#5 -2. 1.1%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\MaximumCount\Five\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#4 -3. 1.0%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\MaximumCount\Five\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#3 -4. 0.9%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\MaximumCount\Five\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#2 -5. 0.8%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\MaximumCount\Five\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#1 +1. 1.6%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#9 +2. 1.5%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#8 +3. 1.4%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#7 +4. 1.3%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#6 +5. 1.2%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#5 -There are 2 additional slow tests that are not listed here. +There are 6 additional slow tests that are not listed here. Time: %s, Memory: %s -OK (9 tests, 9 assertions) +OK (13 tests, 13 assertions) diff --git a/test/EndToEnd/MaximumDuration/Fifty/SleeperTest.php b/test/EndToEnd/MaximumDuration/Fifty/SleeperTest.php deleted file mode 100644 index f9ee5256..00000000 --- a/test/EndToEnd/MaximumDuration/Fifty/SleeperTest.php +++ /dev/null @@ -1,192 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - public function testSleeperSleepsJustBelowMaximumDuration(): void - { - $milliseconds = 30; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - public function testSleeperSleepsJustAboveDefaultMaximumDuration(): void - { - $milliseconds = 70; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * This DocBlock is intentionally left without a useful comment or annotation. - */ - public function testSleeperSleepsWithDocBlockWithoutSlowThresholdAnnotation(): void - { - $milliseconds = 90; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 3.14 - */ - public function testSleeperSleepsWithDocBlockWithMaximumDurationAnnotationWhereValueIsNotAnInt(): void - { - $milliseconds = 110; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 140 - */ - public function testSleeperSleepsShorterThanMaximumDurationFromMaximumDurationAnnotation(): void - { - $milliseconds = 130; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 150 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromMaximumDurationAnnotation(): void - { - $milliseconds = 150; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @maximumDuration 160 - * - * @slowThreshold 120 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromMaximumDurationAnnotationWhenSlowThresholdAnnotationIsPresentAfterMaximumDuration(): void - { - $milliseconds = 170; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @slowThreshold 120 - * - * @maximumDuration 180 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromMaximumDurationAnnotationWhenSlowThresholdAnnotationIsPresentBeforeMaximumDuration(): void - { - $milliseconds = 200; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 - * - * @slowThreshold 3.14 - */ - public function testSleeperSleepsWithDocBlockWithSlowThresholdAnnotationWhereValueIsNotAnInt(): void - { - $milliseconds = 40; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 - * - * @slowThreshold 100 - */ - public function testSleeperSleepsShorterThanMaximumDurationFromSlowThresholdAnnotation(): void - { - $milliseconds = 80; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - /** - * @see https://github.com/johnkary/phpunit-speedtrap/blob/1.0/src/JohnKary/PHPUnit/Listener/SpeedTrapListener.php#L309-L331 - * - * @slowThreshold 200 - */ - public function testSleeperSleepsLongerThanMaximumDurationFromSlowThresholdAnnotation(): void - { - $milliseconds = 220; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } -} diff --git a/test/EndToEnd/MaximumDuration/Fifty/phpunit.xml b/test/EndToEnd/MaximumDuration/Fifty/phpunit.xml index a621471c..faab7811 100644 --- a/test/EndToEnd/MaximumDuration/Fifty/phpunit.xml +++ b/test/EndToEnd/MaximumDuration/Fifty/phpunit.xml @@ -21,8 +21,8 @@ - - . + + ../../../Fixture/ diff --git a/test/EndToEnd/MaximumDuration/Fifty/test.phpt b/test/EndToEnd/MaximumDuration/Fifty/test.phpt index af4b3638..ea603f8e 100644 --- a/test/EndToEnd/MaximumDuration/Fifty/test.phpt +++ b/test/EndToEnd/MaximumDuration/Fifty/test.phpt @@ -21,18 +21,23 @@ Runtime: %s Configuration: %Stest/EndToEnd/MaximumDuration/Fifty/phpunit.xml Random Seed: %s -............ 12 / 12 (100%) +............. 13 / 13 (100%) -Detected 7 tests that took longer than expected. +Detected 12 tests that took longer than expected. -1. 0.2%s (0.200) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\MaximumDuration\Fifty\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromSlowThresholdAnnotation -2. 0.2%s (0.180) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\MaximumDuration\Fifty\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromMaximumDurationAnnotationWhenSlowThresholdAnnotationIsPresentBeforeMaximumDuration -3. 0.1%s (0.160) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\MaximumDuration\Fifty\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromMaximumDurationAnnotationWhenSlowThresholdAnnotationIsPresentAfterMaximumDuration -4. 0.1%s (0.150) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\MaximumDuration\Fifty\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromMaximumDurationAnnotation -5. 0.1%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\MaximumDuration\Fifty\SleeperTest::testSleeperSleepsWithDocBlockWithMaximumDurationAnnotationWhereValueIsNotAnInt -6. 0.0%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\MaximumDuration\Fifty\SleeperTest::testSleeperSleepsWithDocBlockWithoutSlowThresholdAnnotation -7. 0.0%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\MaximumDuration\Fifty\SleeperTest::testSleeperSleepsJustAboveDefaultMaximumDuration + 1. 1.6%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#9 + 2. 1.5%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#8 + 3. 1.4%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#7 + 4. 1.3%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#6 + 5. 1.2%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#5 + 6. 1.1%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#4 + 7. 1.0%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#3 + 8. 0.9%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#2 + 9. 0.8%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#1 +10. 0.7%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#0 + +There are 2 additional slow tests that are not listed here. Time: %s, Memory: %s -OK (12 tests, 12 assertions) +OK (13 tests, 13 assertions) diff --git a/test/EndToEnd/NoOutput/SleeperTest.php b/test/EndToEnd/NoOutput/SleeperTest.php deleted file mode 100644 index ef8fdbdd..00000000 --- a/test/EndToEnd/NoOutput/SleeperTest.php +++ /dev/null @@ -1,84 +0,0 @@ -sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - public function testSleeperSleepsJustBelowDefaultMaximumDuration(): void - { - $milliseconds = 400; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->sleep(); - - self::assertSame($milliseconds, $sleeper->milliseconds()); - } - - public function testSleeperSleepsJustAboveDefaultMaximumDuration(): void - { - $milliseconds = 600; - - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); - - $sleeper->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(): \Generator - { - $values = \range( - 700, - 1600, - 100, - ); - - foreach ($values as $value) { - yield $value => [ - $value, - ]; - } - } -} diff --git a/test/EndToEnd/NoOutput/phpunit.xml b/test/EndToEnd/NoOutput/phpunit.xml index d4aee73a..681f1320 100644 --- a/test/EndToEnd/NoOutput/phpunit.xml +++ b/test/EndToEnd/NoOutput/phpunit.xml @@ -25,8 +25,8 @@ - - . + + ../../Fixture/ diff --git a/test/Phar/SleeperTest.php b/test/Fixture/SleeperTest.php similarity index 77% rename from test/Phar/SleeperTest.php rename to test/Fixture/SleeperTest.php index 69df5899..a4c501af 100644 --- a/test/Phar/SleeperTest.php +++ b/test/Fixture/SleeperTest.php @@ -11,21 +11,18 @@ * @see https://github.com/ergebnis/phpunit-slow-test-detector */ -namespace Ergebnis\PHPUnit\SlowTestDetector\Test\Phar; +namespace Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture; -use Ergebnis\PHPUnit\SlowTestDetector\Test; use PHPUnit\Framework; -#[Framework\Attributes\CoversClass(Test\Fixture\Sleeper::class)] +#[Framework\Attributes\CoversClass(Sleeper::class)] final class SleeperTest extends Framework\TestCase { - use Test\Util\Helper; - public function testSleeperDoesNotSleepAtAll(): void { $milliseconds = 0; - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + $sleeper = Sleeper::fromMilliseconds($milliseconds); $sleeper->sleep(); @@ -36,7 +33,7 @@ public function testSleeperSleepsJustBelowDefaultMaximumDuration(): void { $milliseconds = 400; - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + $sleeper = Sleeper::fromMilliseconds($milliseconds); $sleeper->sleep(); @@ -47,7 +44,7 @@ public function testSleeperSleepsJustAboveDefaultMaximumDuration(): void { $milliseconds = 600; - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + $sleeper = Sleeper::fromMilliseconds($milliseconds); $sleeper->sleep(); @@ -57,7 +54,7 @@ public function testSleeperSleepsJustAboveDefaultMaximumDuration(): void #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void { - $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); + $sleeper = Sleeper::fromMilliseconds($milliseconds); $sleeper->sleep(); diff --git a/test/Phar/phpunit.xml b/test/Phar/phpunit.xml index fc72319c..ac4fbf01 100644 --- a/test/Phar/phpunit.xml +++ b/test/Phar/phpunit.xml @@ -26,8 +26,8 @@ - - . + + ../Fixture/