From 4c8bf4b2fdd47ba970b4958e2718b3d8c461d87f Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Tue, 19 Aug 2025 11:11:10 +0100 Subject: [PATCH 1/2] chore: uses phpunit `v11.5.33` --- composer.json | 4 ++-- .../Runner/ResultCache/DefaultResultCache.php | 20 +++++++++---------- src/Result.php | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index d9a55865..f8cba757 100644 --- a/composer.json +++ b/composer.json @@ -24,11 +24,11 @@ "pestphp/pest-plugin": "^3.0.0", "pestphp/pest-plugin-arch": "^3.1.1", "pestphp/pest-plugin-mutate": "^3.0.5", - "phpunit/phpunit": "^11.5.15" + "phpunit/phpunit": "^11.5.33" }, "conflict": { "filp/whoops": "<2.16.0", - "phpunit/phpunit": ">11.5.15", + "phpunit/phpunit": ">11.5.33", "sebastian/exporter": "<6.0.0", "webmozart/assert": "<1.11.0" }, diff --git a/overrides/Runner/ResultCache/DefaultResultCache.php b/overrides/Runner/ResultCache/DefaultResultCache.php index fde6bad9..3eb41a83 100644 --- a/overrides/Runner/ResultCache/DefaultResultCache.php +++ b/overrides/Runner/ResultCache/DefaultResultCache.php @@ -49,7 +49,7 @@ use const DIRECTORY_SEPARATOR; use const LOCK_EX; use PHPUnit\Framework\TestStatus\TestStatus; -use PHPUnit\Runner\DirectoryCannotBeCreatedException; +use PHPUnit\Runner\DirectoryDoesNotExistException; use PHPUnit\Runner\Exception; use PHPUnit\Util\Filesystem; @@ -98,28 +98,28 @@ final class DefaultResultCache implements ResultCache $this->cacheFilename = $filepath ?? $_ENV['PHPUNIT_RESULT_CACHE'] ?? self::DEFAULT_RESULT_CACHE_FILENAME; } - public function setStatus(string $id, TestStatus $status): void + public function setStatus(ResultCacheId $id, TestStatus $status): void { if ($status->isSuccess()) { return; } - $this->defects[$id] = $status; + $this->defects[$id->asString()] = $status; } - public function status(string $id): TestStatus + public function status(ResultCacheId $id): TestStatus { - return $this->defects[$id] ?? TestStatus::unknown(); + return $this->defects[$id->asString()] ?? TestStatus::unknown(); } - public function setTime(string $id, float $time): void + public function setTime(ResultCacheId $id, float $time): void { - $this->times[$id] = $time; + $this->times[$id->asString()] = $time; } - public function time(string $id): float + public function time(ResultCacheId $id): float { - return $this->times[$id] ?? 0.0; + return $this->times[$id->asString()] ?? 0.0; } public function mergeWith(self $other): void @@ -179,7 +179,7 @@ final class DefaultResultCache implements ResultCache public function persist(): void { if (! Filesystem::createDirectory(dirname($this->cacheFilename))) { - throw new DirectoryCannotBeCreatedException($this->cacheFilename); + throw new DirectoryDoesNotExistException(dirname($this->cacheFilename)); } $data = [ diff --git a/src/Result.php b/src/Result.php index 98e9e8b6..233ffa2d 100644 --- a/src/Result.php +++ b/src/Result.php @@ -40,7 +40,7 @@ final class Result */ public static function exitCode(Configuration $configuration, TestResult $result): int { - if ($result->wasSuccessfulIgnoringPhpunitWarnings()) { + if ($result->wasSuccessful()) { if ($configuration->failOnWarning()) { $warnings = $result->numberOfTestsWithTestTriggeredPhpunitWarningEvents() + count($result->warnings()) @@ -60,7 +60,7 @@ final class Result return self::FAILURE_EXIT; } - if ($result->wasSuccessfulIgnoringPhpunitWarnings()) { + if ($result->wasSuccessful()) { if ($configuration->failOnRisky() && $result->hasTestConsideredRiskyEvents()) { $returnCode = self::FAILURE_EXIT; } From 165c879fe6e66926235d562123db206861aa6cc1 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Tue, 19 Aug 2025 11:11:21 +0100 Subject: [PATCH 2/2] release: 3.8.3 --- src/Pest.php | 2 +- .../visual_snapshot_of_help_command_output.snap | 16 ++++++++++++++-- .../visual_snapshot_of_help_command_output.snap | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Pest.php b/src/Pest.php index db27e206..324734cc 100644 --- a/src/Pest.php +++ b/src/Pest.php @@ -6,7 +6,7 @@ namespace Pest; function version(): string { - return '3.8.2'; + return '3.8.3'; } function testDirectory(string $file = ''): string diff --git a/tests/.pest/snapshots/Visual/Help/visual_snapshot_of_help_command_output.snap b/tests/.pest/snapshots/Visual/Help/visual_snapshot_of_help_command_output.snap index da7acad7..004c298e 100644 --- a/tests/.pest/snapshots/Visual/Help/visual_snapshot_of_help_command_output.snap +++ b/tests/.pest/snapshots/Visual/Help/visual_snapshot_of_help_command_output.snap @@ -1,5 +1,5 @@ - Pest Testing Framework 3.8.2. + Pest Testing Framework 3.8.3. USAGE: pest [options] @@ -53,7 +53,7 @@ --disallow-test-output ................. Be strict about output during tests --enforce-time-limit ................. Enforce time limit based on test size --default-time-limit [sec] Timeout in seconds for tests that have no declared size - --dont-report-useless-tests .. Do not report tests that do not test anything + --do-not-report-useless-tests Do not report tests that do not test anything --stop-on-defect ... Stop after first error, failure, warning, or risky test --stop-on-error ..................................... Stop after first error --stop-on-failure ................................. Stop after first failure @@ -68,9 +68,20 @@ --fail-on-risky Signal failure using shell exit code when a test was considered risky --fail-on-deprecation Signal failure using shell exit code when a deprecation was triggered --fail-on-phpunit-deprecation Signal failure using shell exit code when a PHPUnit deprecation was triggered + --fail-on-phpunit-warning Signal failure using shell exit code when a PHPUnit warning was triggered --fail-on-notice Signal failure using shell exit code when a notice was triggered --fail-on-skipped Signal failure using shell exit code when a test was skipped --fail-on-incomplete Signal failure using shell exit code when a test was marked incomplete + --fail-on-all-issues Signal failure using shell exit code when an issue is triggered + --do-not-fail-on-empty-test-suite Do not signal failure using shell exit code when no tests were run + --do-not-fail-on-warning Do not signal failure using shell exit code when a warning was triggered + --do-not-fail-on-risky Do not signal failure using shell exit code when a test was considered risky + --do-not-fail-on-deprecation Do not signal failure using shell exit code when a deprecation was triggered + --do-not-fail-on-phpunit-deprecation Do not signal failure using shell exit code when a PHPUnit deprecation was triggered + --do-not-fail-on-phpunit-warning Do not signal failure using shell exit code when a PHPUnit warning was triggered + --do-not-fail-on-notice Do not signal failure using shell exit code when a notice was triggered + --do-not-fail-on-skipped Do not signal failure using shell exit code when a test was skipped + --do-not-fail-on-incomplete Do not signal failure using shell exit code when a test was marked incomplete --cache-result ............................ Write test results to cache file --do-not-cache-result .............. Do not write test results to cache file --order-by [order] Run tests in order: default|defects|depends|duration|no-depends|random|reverse|size @@ -91,6 +102,7 @@ --display-errors ............. Display details for errors triggered by tests --display-notices ........... Display details for notices triggered by tests --display-warnings ......... Display details for warnings triggered by tests + --display-all-issues ..... Display details for all issues that are triggered --reverse-list .............................. Print defects in reverse order --teamcity . Replace default progress and result output with TeamCity format --testdox ................ Replace default result output with TestDox format diff --git a/tests/.pest/snapshots/Visual/Version/visual_snapshot_of_help_command_output.snap b/tests/.pest/snapshots/Visual/Version/visual_snapshot_of_help_command_output.snap index cd2d2cfb..9b541f77 100644 --- a/tests/.pest/snapshots/Visual/Version/visual_snapshot_of_help_command_output.snap +++ b/tests/.pest/snapshots/Visual/Version/visual_snapshot_of_help_command_output.snap @@ -1,3 +1,3 @@ - Pest Testing Framework 3.8.2. + Pest Testing Framework 3.8.3.