From b9334b9387a7e36bd4b6ad62aafdb87667c1115a 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 | 15 ++- Makefile | 4 +- composer.json | 2 +- composer.lock | 2 +- psalm-baseline.xml | 15 ++- src/Extension.php | 91 +++++++++++-------- .../{ => Version10}/Default/phpunit.xml | 6 +- .../{ => Version10}/Default/test.phpt | 26 +++--- .../MaximumCount/Five/phpunit.xml | 6 +- .../MaximumCount/Five/test.phpt | 16 ++-- .../MaximumDuration/Fifty/phpunit.xml | 6 +- .../MaximumDuration/Fifty/test.phpt | 26 +++--- .../{ => Version10}/NoOutput/phpunit.xml | 6 +- .../{ => Version10}/NoOutput/test.phpt | 4 +- test/EndToEnd/{ => Version10}/phpunit.xml | 8 +- test/Fixture/{ => Version10}/SleeperTest.php | 13 +-- 16 files changed, 144 insertions(+), 102 deletions(-) rename test/EndToEnd/{ => Version10}/Default/phpunit.xml (83%) rename test/EndToEnd/{ => Version10}/Default/test.phpt (51%) rename test/EndToEnd/{ => Version10}/MaximumCount/Five/phpunit.xml (79%) rename test/EndToEnd/{ => Version10}/MaximumCount/Five/test.phpt (56%) rename test/EndToEnd/{ => Version10}/MaximumDuration/Fifty/phpunit.xml (79%) rename test/EndToEnd/{ => Version10}/MaximumDuration/Fifty/test.phpt (50%) rename test/EndToEnd/{ => Version10}/NoOutput/phpunit.xml (83%) rename test/EndToEnd/{ => Version10}/NoOutput/test.phpt (62%) rename test/EndToEnd/{ => Version10}/phpunit.xml (81%) rename test/Fixture/{ => Version10}/SleeperTest.php (78%) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 28867407..cf5baebc 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,8 +485,11 @@ 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" - name: "Install ${{ matrix.dependencies }} dependencies with composer" uses: "ergebnis/.github/actions/composer/install@1.8.0" @@ -490,7 +497,9 @@ jobs: dependencies: "${{ matrix.dependencies }}" - name: "Run unit tests with phpunit/phpunit" + 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" + if: "matrix.phpunit-version == '10.4.2'" + run: "vendor/bin/phpunit --colors=always --configuration=test/EndToEnd/Version10/phpunit.xml" diff --git a/Makefile b/Makefile index de28c7b5..9411a5e1 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; 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; 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 1759238a..f995e44e 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -30,6 +30,19 @@ $maximumDuration + + TestPassedSubscriber + + + + + TestPreparedSubscriber + + + + + TestRunnerExecutionFinishedSubscriber + @@ -51,7 +64,7 @@ milliseconds * 1000]]> - + 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/phpunit.xml b/test/EndToEnd/Version10/Default/phpunit.xml similarity index 83% rename from test/EndToEnd/Default/phpunit.xml rename to test/EndToEnd/Version10/Default/phpunit.xml index 681f1320..b2f10d9d 100644 --- a/test/EndToEnd/Default/phpunit.xml +++ b/test/EndToEnd/Version10/Default/phpunit.xml @@ -1,11 +1,11 @@ - ../../Fixture/ + ../../../Fixture/ diff --git a/test/EndToEnd/Default/test.phpt b/test/EndToEnd/Version10/Default/test.phpt similarity index 51% rename from test/EndToEnd/Default/test.phpt rename to test/EndToEnd/Version10/Default/test.phpt index 4457ca26..169f361a 100644 --- a/test/EndToEnd/Default/test.phpt +++ b/test/EndToEnd/Version10/Default/test.phpt @@ -7,9 +7,9 @@ declare(strict_types=1); use PHPUnit\TextUI; -$_SERVER['argv'][] = '--configuration=test/EndToEnd/Default/phpunit.xml'; +$_SERVER['argv'][] = '--configuration=test/EndToEnd/Version10/Default/phpunit.xml'; -require_once __DIR__ . '/../../../vendor/autoload.php'; +require_once __DIR__ . '/../../../../vendor/autoload.php'; $application = new TextUI\Application(); @@ -18,23 +18,23 @@ $application->run($_SERVER['argv']); PHPUnit %s by Sebastian Bergmann and contributors. Runtime: %s -Configuration: %Stest/EndToEnd/Default/phpunit.xml +Configuration: %Stest/EndToEnd/Version10/Default/phpunit.xml Random Seed: %s ............. 13 / 13 (100%) Detected 11 tests that took longer than expected. - 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 + 1. 1.6%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#9 + 2. 1.5%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#8 + 3. 1.4%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#7 + 4. 1.3%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#6 + 5. 1.2%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#5 + 6. 1.1%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#4 + 7. 1.0%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#3 + 8. 0.9%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#2 + 9. 0.8%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#1 +10. 0.7%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#0 There is 1 additional slow test that is not listed here. diff --git a/test/EndToEnd/MaximumCount/Five/phpunit.xml b/test/EndToEnd/Version10/MaximumCount/Five/phpunit.xml similarity index 79% rename from test/EndToEnd/MaximumCount/Five/phpunit.xml rename to test/EndToEnd/Version10/MaximumCount/Five/phpunit.xml index f7d4f07b..2a8fa7f9 100644 --- a/test/EndToEnd/MaximumCount/Five/phpunit.xml +++ b/test/EndToEnd/Version10/MaximumCount/Five/phpunit.xml @@ -1,11 +1,11 @@ - ../../../Fixture/ + ../../../../Fixture/ diff --git a/test/EndToEnd/MaximumCount/Five/test.phpt b/test/EndToEnd/Version10/MaximumCount/Five/test.phpt similarity index 56% rename from test/EndToEnd/MaximumCount/Five/test.phpt rename to test/EndToEnd/Version10/MaximumCount/Five/test.phpt index 40fca2d5..b73ec293 100644 --- a/test/EndToEnd/MaximumCount/Five/test.phpt +++ b/test/EndToEnd/Version10/MaximumCount/Five/test.phpt @@ -7,9 +7,9 @@ declare(strict_types=1); use PHPUnit\TextUI; -$_SERVER['argv'][] = '--configuration=test/EndToEnd/MaximumCount/Five/phpunit.xml'; +$_SERVER['argv'][] = '--configuration=test/EndToEnd/Version10/MaximumCount/Five/phpunit.xml'; -require_once __DIR__ . '/../../../../vendor/autoload.php'; +require_once __DIR__ . '/../../../../../vendor/autoload.php'; $application = new TextUI\Application(); @@ -18,18 +18,18 @@ $application->run($_SERVER['argv']); PHPUnit %s by Sebastian Bergmann and contributors. Runtime: %s -Configuration: %Stest/EndToEnd/MaximumCount/Five/phpunit.xml +Configuration: %Stest/EndToEnd/Version10/MaximumCount/Five/phpunit.xml Random Seed: %s ............. 13 / 13 (100%) Detected 11 tests that took longer than expected. -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 +1. 1.6%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#9 +2. 1.5%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#8 +3. 1.4%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#7 +4. 1.3%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#6 +5. 1.2%s (0.500) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#5 There are 6 additional slow tests that are not listed here. diff --git a/test/EndToEnd/MaximumDuration/Fifty/phpunit.xml b/test/EndToEnd/Version10/MaximumDuration/Fifty/phpunit.xml similarity index 79% rename from test/EndToEnd/MaximumDuration/Fifty/phpunit.xml rename to test/EndToEnd/Version10/MaximumDuration/Fifty/phpunit.xml index faab7811..056fbeaf 100644 --- a/test/EndToEnd/MaximumDuration/Fifty/phpunit.xml +++ b/test/EndToEnd/Version10/MaximumDuration/Fifty/phpunit.xml @@ -1,11 +1,11 @@ - ../../../Fixture/ + ../../../../Fixture/ diff --git a/test/EndToEnd/MaximumDuration/Fifty/test.phpt b/test/EndToEnd/Version10/MaximumDuration/Fifty/test.phpt similarity index 50% rename from test/EndToEnd/MaximumDuration/Fifty/test.phpt rename to test/EndToEnd/Version10/MaximumDuration/Fifty/test.phpt index ea603f8e..de07ab30 100644 --- a/test/EndToEnd/MaximumDuration/Fifty/test.phpt +++ b/test/EndToEnd/Version10/MaximumDuration/Fifty/test.phpt @@ -7,9 +7,9 @@ declare(strict_types=1); use PHPUnit\TextUI; -$_SERVER['argv'][] = '--configuration=test/EndToEnd/MaximumDuration/Fifty/phpunit.xml'; +$_SERVER['argv'][] = '--configuration=test/EndToEnd/Version10/MaximumDuration/Fifty/phpunit.xml'; -require_once __DIR__ . '/../../../../vendor/autoload.php'; +require_once __DIR__ . '/../../../../../vendor/autoload.php'; $application = new TextUI\Application(); @@ -18,23 +18,23 @@ $application->run($_SERVER['argv']); PHPUnit %s by Sebastian Bergmann and contributors. Runtime: %s -Configuration: %Stest/EndToEnd/MaximumDuration/Fifty/phpunit.xml +Configuration: %Stest/EndToEnd/Version10/MaximumDuration/Fifty/phpunit.xml Random Seed: %s ............. 13 / 13 (100%) Detected 12 tests that took longer than expected. - 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 + 1. 1.6%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#9 + 2. 1.5%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#8 + 3. 1.4%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#7 + 4. 1.3%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#6 + 5. 1.2%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#5 + 6. 1.1%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#4 + 7. 1.0%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#3 + 8. 0.9%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#2 + 9. 0.8%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#1 +10. 0.7%s (0.050) Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10\SleeperTest::testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider#0 There are 2 additional slow tests that are not listed here. diff --git a/test/EndToEnd/NoOutput/phpunit.xml b/test/EndToEnd/Version10/NoOutput/phpunit.xml similarity index 83% rename from test/EndToEnd/NoOutput/phpunit.xml rename to test/EndToEnd/Version10/NoOutput/phpunit.xml index 681f1320..b2f10d9d 100644 --- a/test/EndToEnd/NoOutput/phpunit.xml +++ b/test/EndToEnd/Version10/NoOutput/phpunit.xml @@ -1,11 +1,11 @@ - ../../Fixture/ + ../../../Fixture/ diff --git a/test/EndToEnd/NoOutput/test.phpt b/test/EndToEnd/Version10/NoOutput/test.phpt similarity index 62% rename from test/EndToEnd/NoOutput/test.phpt rename to test/EndToEnd/Version10/NoOutput/test.phpt index 80e87a04..b97f32b2 100644 --- a/test/EndToEnd/NoOutput/test.phpt +++ b/test/EndToEnd/Version10/NoOutput/test.phpt @@ -7,10 +7,10 @@ declare(strict_types=1); use PHPUnit\TextUI; -$_SERVER['argv'][] = '--configuration=test/EndToEnd/Default/phpunit.xml'; +$_SERVER['argv'][] = '--configuration=test/EndToEnd/Version10/Default/phpunit.xml'; $_SERVER['argv'][] = '--no-output'; -require_once __DIR__ . '/../../../vendor/autoload.php'; +require_once __DIR__ . '/../../../../vendor/autoload.php'; $application = new TextUI\Application(); diff --git a/test/EndToEnd/phpunit.xml b/test/EndToEnd/Version10/phpunit.xml similarity index 81% rename from test/EndToEnd/phpunit.xml rename to test/EndToEnd/Version10/phpunit.xml index e0de2a4a..47cbbdae 100644 --- a/test/EndToEnd/phpunit.xml +++ b/test/EndToEnd/Version10/phpunit.xml @@ -1,14 +1,14 @@ - ../../src/ + ../../../src/ diff --git a/test/Fixture/SleeperTest.php b/test/Fixture/Version10/SleeperTest.php similarity index 78% rename from test/Fixture/SleeperTest.php rename to test/Fixture/Version10/SleeperTest.php index a4c501af..8283f60b 100644 --- a/test/Fixture/SleeperTest.php +++ b/test/Fixture/Version10/SleeperTest.php @@ -11,18 +11,19 @@ * @see https://github.com/ergebnis/phpunit-slow-test-detector */ -namespace Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture; +namespace Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Version10; +use Ergebnis\PHPUnit\SlowTestDetector\Test; use PHPUnit\Framework; -#[Framework\Attributes\CoversClass(Sleeper::class)] +#[Framework\Attributes\CoversClass(Test\Fixture\Sleeper::class)] final class SleeperTest extends Framework\TestCase { public function testSleeperDoesNotSleepAtAll(): void { $milliseconds = 0; - $sleeper = Sleeper::fromMilliseconds($milliseconds); + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); $sleeper->sleep(); @@ -33,7 +34,7 @@ public function testSleeperSleepsJustBelowDefaultMaximumDuration(): void { $milliseconds = 400; - $sleeper = Sleeper::fromMilliseconds($milliseconds); + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); $sleeper->sleep(); @@ -44,7 +45,7 @@ public function testSleeperSleepsJustAboveDefaultMaximumDuration(): void { $milliseconds = 600; - $sleeper = Sleeper::fromMilliseconds($milliseconds); + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); $sleeper->sleep(); @@ -54,7 +55,7 @@ public function testSleeperSleepsJustAboveDefaultMaximumDuration(): void #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanDefaultMaximumDuration')] public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void { - $sleeper = Sleeper::fromMilliseconds($milliseconds); + $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); $sleeper->sleep();