From c8561ae7a54b93d9f8e1d7a018fdec07975603ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sun, 5 Nov 2023 18:16:38 +0100 Subject: [PATCH] Enhancement: Add support for phpunit/phpunit:^9.6.13 --- .github/workflows/integrate.yaml | 23 ++++- Makefile | 4 +- composer.json | 2 +- composer.lock | 2 +- psalm-baseline.xml | 17 +++- src/Extension.php | 91 +++++++++++-------- test/EndToEnd/Default/test.phpt | 43 --------- test/EndToEnd/MaximumDuration/Fifty/test.phpt | 37 -------- .../{ => Version10}/Default/SleeperTest.php | 2 +- .../{ => Version10}/Default/phpunit.xml | 4 +- test/EndToEnd/Version10/Default/test.phpt | 43 +++++++++ .../MaximumCount/Three/SleeperTest.php | 2 +- .../MaximumCount/Three/phpunit.xml | 4 +- .../MaximumCount/Three/test.phpt | 12 +-- .../MaximumDuration/Fifty/SleeperTest.php | 2 +- .../MaximumDuration/Fifty/phpunit.xml | 4 +- .../Version10/MaximumDuration/Fifty/test.phpt | 37 ++++++++ .../{ => Version10}/NoOutput/SleeperTest.php | 2 +- .../{ => Version10}/NoOutput/phpunit.xml | 4 +- .../{ => Version10}/NoOutput/test.phpt | 4 +- test/EndToEnd/{ => Version10}/phpunit.xml | 8 +- 21 files changed, 196 insertions(+), 151 deletions(-) delete mode 100644 test/EndToEnd/Default/test.phpt delete mode 100644 test/EndToEnd/MaximumDuration/Fifty/test.phpt rename test/EndToEnd/{ => Version10}/Default/SleeperTest.php (95%) rename test/EndToEnd/{ => Version10}/Default/phpunit.xml (88%) create mode 100644 test/EndToEnd/Version10/Default/test.phpt rename test/EndToEnd/{ => Version10}/MaximumCount/Three/SleeperTest.php (94%) rename test/EndToEnd/{ => Version10}/MaximumCount/Three/phpunit.xml (84%) rename test/EndToEnd/{ => Version10}/MaximumCount/Three/test.phpt (56%) rename test/EndToEnd/{ => Version10}/MaximumDuration/Fifty/SleeperTest.php (98%) rename test/EndToEnd/{ => Version10}/MaximumDuration/Fifty/phpunit.xml (84%) create mode 100644 test/EndToEnd/Version10/MaximumDuration/Fifty/test.phpt rename test/EndToEnd/{ => Version10}/NoOutput/SleeperTest.php (91%) rename test/EndToEnd/{ => Version10}/NoOutput/phpunit.xml (88%) rename test/EndToEnd/{ => Version10}/NoOutput/test.phpt (62%) rename test/EndToEnd/{ => Version10}/phpunit.xml (81%) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 28867407..e8ac5231 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -449,6 +449,10 @@ jobs: - "8.2" - "8.3" + phpunit-version: + - "9.6.13" + - "10.4.2" + dependencies: - "lowest" - "locked" @@ -481,16 +485,25 @@ jobs: uses: "actions/cache@v3.3.2" with: path: "${{ env.COMPOSER_CACHE_DIR }}" - key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" - restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" + key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-phpunit-${{ matrix.phpunit-version }}-${{ hashFiles('composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-phpunit-${{ matrix.phpunit-version }}-" + + - name: "Require phpunit/phpunit:^${{ matrix.phpunit-version }}" + run: "composer require phpunit/phpunit:^${{ matrix.phpunit-version }} --ansi --no-interaction --no-progress --update-with-all-dependencies" - name: "Install ${{ matrix.dependencies }} dependencies with composer" uses: "ergebnis/.github/actions/composer/install@1.8.0" with: dependencies: "${{ matrix.dependencies }}" - - name: "Run unit tests with phpunit/phpunit" + - name: "Run unit tests with phpunit/phpunit:10.4.2" + if: "matrix.phpunit-version == '10.4.2'" run: "vendor/bin/phpunit --colors=always --configuration=test/Unit/phpunit.xml" - - name: "Run end-to-end tests with phpunit/phpunit" - run: "vendor/bin/phpunit --colors=always --configuration=test/EndToEnd/phpunit.xml" + - name: "Run end-to-end tests with phpunit/phpunit:10.4.2" + if: "matrix.phpunit-version == '10.4.2'" + run: "vendor/bin/phpunit --colors=always --configuration=test/EndToEnd/Version10/phpunit.xml" + + - name: "Run end-to-end tests with phpunit/phpunit:9.6.13" + if: "matrix.phpunit-version == '9.6.13'" + run: "vendor/bin/phpunit --colors=always --configuration=test/EndToEnd/Version9/phpunit.xml" diff --git a/Makefile b/Makefile index de28c7b5..de34ec74 100644 --- a/Makefile +++ b/Makefile @@ -59,8 +59,8 @@ static-code-analysis-baseline: vendor ## Generates a baseline for static code an .PHONY: tests tests: vendor ## Runs unit and end-to-end tests with phpunit/phpunit mkdir -p .build/phpunit - vendor/bin/phpunit --configuration=test/Unit/phpunit.xml - vendor/bin/phpunit --configuration=test/EndToEnd/phpunit.xml + composer require phpunit/phpunit:10.4.2 --no-interaction --no-progress --update-with-all-dependencies; vendor/bin/phpunit --configuration=test/Unit/phpunit.xml; git checkout HEAD -- composer.json composer.lock + composer require phpunit/phpunit:10.4.2 --no-interaction --no-progress --update-with-all-dependencies; vendor/bin/phpunit --configuration=test/EndToEnd/Version10/phpunit.xml; git checkout HEAD -- composer.json composer.lock vendor: composer.json composer.lock composer validate --strict diff --git a/composer.json b/composer.json index 59dc2dd4..61ab2f19 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ }, "require": { "php": "~8.1.0 || ~8.2.0 || ~8.3.0", - "phpunit/phpunit": "^10.4.2" + "phpunit/phpunit": "^9.6.13 || ^10.4.2" }, "require-dev": { "ergebnis/composer-normalize": "^2.39.0", diff --git a/composer.lock b/composer.lock index 6a9d70db..829d421b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "727e83dd50cb23b74aebbf4219d34872", + "content-hash": "0c53e2f57ce175e72649d6907e631b6c", "packages": [ { "name": "myclabs/deep-copy", diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 5d32a646..32f75bb5 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -30,6 +30,19 @@ $maximumDuration + + TestPassedSubscriber + + + + + TestPreparedSubscriber + + + + + TestRunnerExecutionFinishedSubscriber + @@ -46,12 +59,12 @@ NullReporter - + provideMillisecondsGreaterThanDefaultMaximumDuration - + provideMillisecondsGreaterThanDefaultMaximumDuration diff --git a/src/Extension.php b/src/Extension.php index 76dff55a..4e2f9703 100644 --- a/src/Extension.php +++ b/src/Extension.php @@ -16,50 +16,69 @@ use PHPUnit\Runner; use PHPUnit\TextUI; -final class Extension implements Runner\Extension\Extension -{ - public function bootstrap( - TextUI\Configuration\Configuration $configuration, - Runner\Extension\Facade $facade, - Runner\Extension\ParameterCollection $parameters, - ): void { - if ($configuration->noOutput()) { - return; - } +if (1 !== \preg_match('/(?P\d+)\.(?P\d+)\.(?P\d+)/', Runner\Version::id(), $matches)) { + throw new \RuntimeException(\sprintf( + 'Unable to determine PHPUnit version from version identifier "%s".', + Runner\Version::id(), + )); +} - $maximumCount = Count::fromInt(10); +$major = (int) $matches['major']; - if ($parameters->has('maximum-count')) { - $maximumCount = Count::fromInt((int) $parameters->get('maximum-count')); - } +if (10 <= $major) { + /** + * @internal + */ + final class Extension implements Runner\Extension\Extension + { + public function bootstrap( + TextUI\Configuration\Configuration $configuration, + Runner\Extension\Facade $facade, + Runner\Extension\ParameterCollection $parameters, + ): void { + if ($configuration->noOutput()) { + return; + } - $maximumDuration = Duration::fromMilliseconds(500); + $maximumCount = Count::fromInt(10); - if ($parameters->has('maximum-duration')) { - $maximumDuration = Duration::fromMilliseconds((int) $parameters->get('maximum-duration')); - } + if ($parameters->has('maximum-count')) { + $maximumCount = Count::fromInt((int) $parameters->get('maximum-count')); + } - $collector = new Collector\DefaultCollector(); + $maximumDuration = Duration::fromMilliseconds(500); - $reporter = new Reporter\DefaultReporter( - new Formatter\DefaultDurationFormatter(), - $maximumDuration, - $maximumCount, - ); + if ($parameters->has('maximum-duration')) { + $maximumDuration = Duration::fromMilliseconds((int) $parameters->get('maximum-duration')); + } - $timeKeeper = new TimeKeeper(); + $collector = new Collector\DefaultCollector(); - $facade->registerSubscribers( - new Subscriber\TestPreparedSubscriber($timeKeeper), - new Subscriber\TestPassedSubscriber( + $reporter = new Reporter\DefaultReporter( + new Formatter\DefaultDurationFormatter(), $maximumDuration, - $timeKeeper, - $collector, - ), - new Subscriber\TestRunnerExecutionFinishedSubscriber( - $collector, - $reporter, - ), - ); + $maximumCount, + ); + + $timeKeeper = new TimeKeeper(); + + $facade->registerSubscribers( + new Subscriber\TestPreparedSubscriber($timeKeeper), + new Subscriber\TestPassedSubscriber( + $maximumDuration, + $timeKeeper, + $collector, + ), + new Subscriber\TestRunnerExecutionFinishedSubscriber( + $collector, + $reporter, + ), + ); + } } +} else { + throw new \RuntimeException(\sprintf( + 'Unable to select extension for PHPUnit version with version identifier "%s".', + Runner\Version::id(), + )); } diff --git a/test/EndToEnd/Default/test.phpt b/test/EndToEnd/Default/test.phpt deleted file mode 100644 index 7bce1932..00000000 --- a/test/EndToEnd/Default/test.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -With default configuration of extension ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -Runtime: %s -Configuration: %Stest/EndToEnd/Default/phpunit.xml -Random Seed: %s - -............ 12 / 12 (100%) - -Detected 11 tests that took longer than expected. - - 1. 1.0%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#10 - 2. 1.0%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#9 - 3. 0.9%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#8 - 4. 0.9%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#7 - 5. 0.8%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#6 - 6. 0.8%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#5 - 7. 0.7%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#4 - 8. 0.7%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#3 - 9. 0.6%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#2 -10. 0.6%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#1 - -There is 1 additional slow test that is not listed here. - -Time: %s, Memory: %s - -OK (12 tests, 12 assertions) diff --git a/test/EndToEnd/MaximumDuration/Fifty/test.phpt b/test/EndToEnd/MaximumDuration/Fifty/test.phpt deleted file mode 100644 index db8f5c8d..00000000 --- a/test/EndToEnd/MaximumDuration/Fifty/test.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -Configuring "maximum-duration" parameter to 50 milliseconds ---FILE-- -run($_SERVER['argv']); ---EXPECTF-- -PHPUnit %s by Sebastian Bergmann and contributors. - -Runtime: %s -Configuration: %Stest/EndToEnd/MaximumDuration/Fifty/phpunit.xml -Random Seed: %s - -.......... 10 / 10 (100%) - -Detected 6 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 - -Time: %s, Memory: %s - -OK (10 tests, 10 assertions) diff --git a/test/EndToEnd/Default/SleeperTest.php b/test/EndToEnd/Version10/Default/SleeperTest.php similarity index 95% rename from test/EndToEnd/Default/SleeperTest.php rename to test/EndToEnd/Version10/Default/SleeperTest.php index ef69c548..08d12c79 100644 --- a/test/EndToEnd/Default/SleeperTest.php +++ b/test/EndToEnd/Version10/Default/SleeperTest.php @@ -11,7 +11,7 @@ * @see https://github.com/ergebnis/phpunit-slow-test-detector */ -namespace Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Default; +namespace Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\Default; use Ergebnis\PHPUnit\SlowTestDetector\Test; use PHPUnit\Framework; diff --git a/test/EndToEnd/Default/phpunit.xml b/test/EndToEnd/Version10/Default/phpunit.xml similarity index 88% rename from test/EndToEnd/Default/phpunit.xml rename to test/EndToEnd/Version10/Default/phpunit.xml index 54e2050f..b0110e8b 100644 --- a/test/EndToEnd/Default/phpunit.xml +++ b/test/EndToEnd/Version10/Default/phpunit.xml @@ -1,11 +1,11 @@ run($_SERVER['argv']); +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann and contributors. + +Runtime: %s +Configuration: %Stest/EndToEnd/Version10/Default/phpunit.xml +Random Seed: %s + +............ 12 / 12 (100%) + +Detected 11 tests that took longer than expected. + + 1. 1.0%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#10 + 2. 1.0%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#9 + 3. 0.9%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#8 + 4. 0.9%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#7 + 5. 0.8%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#6 + 6. 0.8%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#5 + 7. 0.7%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#4 + 8. 0.7%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#3 + 9. 0.6%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#2 +10. 0.6%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\Default\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#1 + +There is 1 additional slow test that is not listed here. + +Time: %s, Memory: %s + +OK (12 tests, 12 assertions) diff --git a/test/EndToEnd/MaximumCount/Three/SleeperTest.php b/test/EndToEnd/Version10/MaximumCount/Three/SleeperTest.php similarity index 94% rename from test/EndToEnd/MaximumCount/Three/SleeperTest.php rename to test/EndToEnd/Version10/MaximumCount/Three/SleeperTest.php index 3833728c..d2323fdf 100644 --- a/test/EndToEnd/MaximumCount/Three/SleeperTest.php +++ b/test/EndToEnd/Version10/MaximumCount/Three/SleeperTest.php @@ -11,7 +11,7 @@ * @see https://github.com/ergebnis/phpunit-slow-test-detector */ -namespace Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\MaximumCount\Three; +namespace Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\MaximumCount\Three; use Ergebnis\PHPUnit\SlowTestDetector\Test; use PHPUnit\Framework; diff --git a/test/EndToEnd/MaximumCount/Three/phpunit.xml b/test/EndToEnd/Version10/MaximumCount/Three/phpunit.xml similarity index 84% rename from test/EndToEnd/MaximumCount/Three/phpunit.xml rename to test/EndToEnd/Version10/MaximumCount/Three/phpunit.xml index 63f2f4f1..b5b94167 100644 --- a/test/EndToEnd/MaximumCount/Three/phpunit.xml +++ b/test/EndToEnd/Version10/MaximumCount/Three/phpunit.xml @@ -1,11 +1,11 @@ run($_SERVER['argv']); PHPUnit %s by Sebastian Bergmann and contributors. Runtime: %s -Configuration: %Stest/EndToEnd/MaximumCount/Three/phpunit.xml +Configuration: %Stest/EndToEnd/Version10/MaximumCount/Three/phpunit.xml Random Seed: %s ..... 5 / 5 (100%) Detected 4 tests that took longer than expected. -1. 0.7%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\MaximumCount\Three\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#3 -2. 0.6%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\MaximumCount\Three\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#2 -3. 0.6%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\MaximumCount\Three\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#1 +1. 0.7%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\MaximumCount\Three\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#3 +2. 0.6%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\MaximumCount\Three\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#2 +3. 0.6%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\MaximumCount\Three\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#1 There is 1 additional slow test that is not listed here. diff --git a/test/EndToEnd/MaximumDuration/Fifty/SleeperTest.php b/test/EndToEnd/Version10/MaximumDuration/Fifty/SleeperTest.php similarity index 98% rename from test/EndToEnd/MaximumDuration/Fifty/SleeperTest.php rename to test/EndToEnd/Version10/MaximumDuration/Fifty/SleeperTest.php index f7a868c8..94f9fafb 100644 --- a/test/EndToEnd/MaximumDuration/Fifty/SleeperTest.php +++ b/test/EndToEnd/Version10/MaximumDuration/Fifty/SleeperTest.php @@ -11,7 +11,7 @@ * @see https://github.com/ergebnis/phpunit-slow-test-detector */ -namespace Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\MaximumDuration\Fifty; +namespace Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\MaximumDuration\Fifty; use Ergebnis\PHPUnit\SlowTestDetector\Test; use PHPUnit\Framework; diff --git a/test/EndToEnd/MaximumDuration/Fifty/phpunit.xml b/test/EndToEnd/Version10/MaximumDuration/Fifty/phpunit.xml similarity index 84% rename from test/EndToEnd/MaximumDuration/Fifty/phpunit.xml rename to test/EndToEnd/Version10/MaximumDuration/Fifty/phpunit.xml index 0834e1fe..8efc4ad6 100644 --- a/test/EndToEnd/MaximumDuration/Fifty/phpunit.xml +++ b/test/EndToEnd/Version10/MaximumDuration/Fifty/phpunit.xml @@ -1,11 +1,11 @@ run($_SERVER['argv']); +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann and contributors. + +Runtime: %s +Configuration: %Stest/EndToEnd/Version10/MaximumDuration/Fifty/phpunit.xml +Random Seed: %s + +.......... 10 / 10 (100%) + +Detected 6 tests that took longer than expected. + +1. 0.2%s (0.200) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\MaximumDuration\Fifty\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromSlowThresholdAnnotation +2. 0.2%s (0.180) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\MaximumDuration\Fifty\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromMaximumDurationAnnotationWhenSlowThresholdAnnotationIsPresentBeforeMaximumDuration +3. 0.1%s (0.160) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\MaximumDuration\Fifty\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromMaximumDurationAnnotationWhenSlowThresholdAnnotationIsPresentAfterMaximumDuration +4. 0.1%s (0.150) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\MaximumDuration\Fifty\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromMaximumDurationAnnotation +5. 0.1%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\MaximumDuration\Fifty\SleeperTest::testSleeperSleepsWithDocBlockWithMaximumDurationAnnotationWhereValueIsNotAnInt +6. 0.0%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\MaximumDuration\Fifty\SleeperTest::testSleeperSleepsWithDocBlockWithoutSlowThresholdAnnotation + +Time: %s, Memory: %s + +OK (10 tests, 10 assertions) diff --git a/test/EndToEnd/NoOutput/SleeperTest.php b/test/EndToEnd/Version10/NoOutput/SleeperTest.php similarity index 91% rename from test/EndToEnd/NoOutput/SleeperTest.php rename to test/EndToEnd/Version10/NoOutput/SleeperTest.php index ee5e2310..25749d39 100644 --- a/test/EndToEnd/NoOutput/SleeperTest.php +++ b/test/EndToEnd/Version10/NoOutput/SleeperTest.php @@ -11,7 +11,7 @@ * @see https://github.com/ergebnis/phpunit-slow-test-detector */ -namespace Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\NoOutput; +namespace Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\NoOutput; use Ergebnis\PHPUnit\SlowTestDetector\Test; use PHPUnit\Framework; diff --git a/test/EndToEnd/NoOutput/phpunit.xml b/test/EndToEnd/Version10/NoOutput/phpunit.xml similarity index 88% rename from test/EndToEnd/NoOutput/phpunit.xml rename to test/EndToEnd/Version10/NoOutput/phpunit.xml index 54e2050f..b0110e8b 100644 --- a/test/EndToEnd/NoOutput/phpunit.xml +++ b/test/EndToEnd/Version10/NoOutput/phpunit.xml @@ -1,11 +1,11 @@ - ../../src/ + ../../../src/