chore: merges 4.x

This commit is contained in:
nuno maduro
2026-06-25 20:20:20 +01:00
9 changed files with 54 additions and 9 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2 uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
+1 -1
View File
@@ -32,7 +32,7 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2 uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
+1 -1
View File
@@ -6,7 +6,7 @@ namespace Pest;
function version(): string function version(): string
{ {
return '5.0.0-rc.10'; return '5.0.0-rc.11';
} }
function testDirectory(string $file = ''): string function testDirectory(string $file = ''): string
+3 -1
View File
@@ -251,7 +251,7 @@ final class Tia implements AddsOutput, HandlesArguments, Terminable
return true; return true;
} }
if (str_starts_with($arg, "$argument=")) { if (str_starts_with((string) $arg, "$argument=")) { // @phpstan-ignore-line
return true; return true;
} }
} }
@@ -1489,6 +1489,8 @@ final class Tia implements AddsOutput, HandlesArguments, Terminable
} }
foreach ($arguments as $index => $arg) { foreach ($arguments as $index => $arg) {
$arg = (string) $arg; // @phpstan-ignore-line
if ($arg === '') { if ($arg === '') {
continue; continue;
} }
@@ -1,5 +1,5 @@
Pest Testing Framework 5.0.0-rc.10. Pest Testing Framework 5.0.0-rc.11.
USAGE: pest <file> [options] USAGE: pest <file> [options]
@@ -1,3 +1,3 @@
Pest Testing Framework 5.0.0-rc.10. Pest Testing Framework 5.0.0-rc.11.
+24 -1
View File
@@ -517,6 +517,13 @@
✓ pass ✓ pass
✓ failures ✓ failures
✓ failures with custom message ✓ failures with custom message
✓ not failures
PASS Tests\Features\Expect\toBeEmail
✓ pass
✓ failures
✓ failures with custom message
✓ failures with default message
✓ not failures ✓ not failures
PASS Tests\Features\Expect\toBeEmpty PASS Tests\Features\Expect\toBeEmpty
@@ -1756,6 +1763,18 @@
✓ ensureFilterLengthIsSafe → it accepts filter within custom limit ✓ ensureFilterLengthIsSafe → it accepts filter within custom limit
✓ handleArguments → it returns original arguments when shard option is not present ✓ handleArguments → it returns original arguments when shard option is not present
✓ handleArguments → it removes parallel arguments from test discovery ✓ handleArguments → it removes parallel arguments from test discovery
✓ parseListTestsOutput → it parses Tests\ namespaced classes from --list-tests output
✓ parseListTestsOutput → it deduplicates repeated class names from multiple test methods
✓ parseListTestsOutput → it returns an empty list for output with no matching lines
✓ parseListTestsOutput → it parses non-Tests namespaced classes
✓ parseListTestsOutput → it parses unnamespaced top-level classes
✓ parseListTestsOutput → it strips the P\ Pest prefix but keeps the rest of the FQCN
✓ parseListTestsOutput → it ignores junk lines that lack the " - …::" framing
✓ buildListTestsCommand → it builds the list-tests command with the forwarded --test-directory
✓ buildListTestsCommand → it strips --parallel and -p when building the list-tests command
✓ buildListTestsCommand → it forwards --test-directory even when input arguments include one
✓ buildListTestsCommand → it strips --processes=N when building the list-tests command
✓ buildListTestsCommand → it strips --processes N (space-separated) when building the list-tests command
✓ addOutput → it displays shard information after test execution ✓ addOutput → it displays shard information after test execution
✓ addOutput → it uses singular form for single test file ✓ addOutput → it uses singular form for single test file
✓ addOutput → it returns original exit code when shard is not set ✓ addOutput → it returns original exit code when shard is not set
@@ -1797,6 +1816,10 @@
✓ output format → it returns a 32-character hex xxh128 hash ✓ output format → it returns a 32-character hex xxh128 hash
✓ output format → it returns a stable hash for empty content ✓ output format → it returns a stable hash for empty content
PASS Tests\Unit\Plugins\Tia\IsEnabledForRun
✓ does not throw when an integer --random-order-seed is passed as a separate argv element
✓ still detects --tia when an integer argument is present
PASS Tests\Unit\Preset PASS Tests\Unit\Preset
✓ preset invalid name ✓ preset invalid name
✓ preset → myFramework ✓ preset → myFramework
@@ -1983,4 +2006,4 @@
✓ pass with dataset with ('my-datas-set-value') ✓ pass with dataset with ('my-datas-set-value')
✓ within describe → pass with dataset with ('my-datas-set-value') ✓ within describe → pass with dataset with ('my-datas-set-value')
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 40 todos, 35 skipped, 1370 passed (3068 assertions) Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 40 todos, 35 skipped, 1389 passed (3097 assertions)
@@ -0,0 +1,20 @@
<?php
use Pest\Plugins\Tia;
test('does not throw when an integer --random-order-seed is passed as a separate argv element', function () {
// Mirrors the parallel worker argv (see bin/worker.php), where
// `--random-order-seed` and its value arrive as separate items and the
// seed value is an int rather than a string. Regression test for the
// str_starts_with() TypeError in Tia::argumentPresent() — the same class
// of bug as #1206, which was only fixed in HandleArguments.
$arguments = ['--order-by=random', '--random-order-seed', 1782350398];
expect(Tia::isEnabledForRun($arguments))->toBeFalse();
});
test('still detects --tia when an integer argument is present', function () {
$arguments = ['--tia', '--random-order-seed', 1782350398];
expect(Tia::isEnabledForRun($arguments))->toBeTrue();
});
+2 -2
View File
@@ -24,13 +24,13 @@ test('parallel', function () use ($run) {
$file = file_get_contents(__FILE__); $file = file_get_contents(__FILE__);
$file = preg_replace( $file = preg_replace(
'/\$expected = \'.*?\';/', '/\$expected = \'.*?\';/',
"\$expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 27 skipped, 1353 passed (3015 assertions)';", "\$expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 27 skipped, 1372 passed (3044 assertions)';",
$file, $file,
); );
file_put_contents(__FILE__, $file); file_put_contents(__FILE__, $file);
} }
$expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 27 skipped, 1353 passed (3015 assertions)'; $expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 27 skipped, 1372 passed (3044 assertions)';
expect($output) expect($output)
->toContain("Tests: {$expected}") ->toContain("Tests: {$expected}")