From ac8feafdccdbf6a35b9c3c8dc1adc9fa11e27913 Mon Sep 17 00:00:00 2001 From: Conor Murphy Date: Fri, 26 Jun 2026 05:03:06 +1000 Subject: [PATCH 1/4] fix: guard Tia argv scanning against non-string args (#1736) The Tia plugin scans the raw argv with str_starts_with() in argumentPresent() and hasExplicitPathArgument(). In the parallel worker path (bin/worker.php) the unserialized argv can contain an integer --random-order-seed value as a separate element, which made str_starts_with() throw: TypeError: str_starts_with(): Argument #1 ($haystack) must be of type string, int given This is the same class of bug as #1206, which was only fixed in HandleArguments; it resurfaced in the newer Tia plugin. Cast each argv element to string before scanning, mirroring the #1206 fix. Adds a regression test, and updates the parallel count assertion and the success snapshot to account for it. Co-authored-by: Claude Opus 4.8 --- src/Plugins/Tia.php | 4 +++- tests/.snapshots/success.txt | 6 +++++- tests/Unit/Plugins/Tia/IsEnabledForRun.php | 20 ++++++++++++++++++++ tests/Visual/Parallel.php | 4 ++-- 4 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 tests/Unit/Plugins/Tia/IsEnabledForRun.php diff --git a/src/Plugins/Tia.php b/src/Plugins/Tia.php index 6e6a83d8..ef6c083a 100644 --- a/src/Plugins/Tia.php +++ b/src/Plugins/Tia.php @@ -251,7 +251,7 @@ final class Tia implements AddsOutput, HandlesArguments, Terminable return true; } - if (str_starts_with($arg, "$argument=")) { + if (str_starts_with((string) $arg, "$argument=")) { // @phpstan-ignore-line return true; } } @@ -1489,6 +1489,8 @@ final class Tia implements AddsOutput, HandlesArguments, Terminable } foreach ($arguments as $index => $arg) { + $arg = (string) $arg; // @phpstan-ignore-line + if ($arg === '') { continue; } diff --git a/tests/.snapshots/success.txt b/tests/.snapshots/success.txt index e5337bab..0e38f50f 100644 --- a/tests/.snapshots/success.txt +++ b/tests/.snapshots/success.txt @@ -1752,6 +1752,10 @@ ✓ output format → it returns a 32-character hex xxh128 hash ✓ 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 ✓ preset invalid name ✓ preset → myFramework @@ -1937,4 +1941,4 @@ ✓ 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, 1328 passed (3008 assertions) \ No newline at end of file + Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 40 todos, 35 skipped, 1330 passed (3010 assertions) \ No newline at end of file diff --git a/tests/Unit/Plugins/Tia/IsEnabledForRun.php b/tests/Unit/Plugins/Tia/IsEnabledForRun.php new file mode 100644 index 00000000..cbcf6284 --- /dev/null +++ b/tests/Unit/Plugins/Tia/IsEnabledForRun.php @@ -0,0 +1,20 @@ +toBeFalse(); +}); + +test('still detects --tia when an integer argument is present', function () { + $arguments = ['--tia', '--random-order-seed', 1782350398]; + + expect(Tia::isEnabledForRun($arguments))->toBeTrue(); +}); diff --git a/tests/Visual/Parallel.php b/tests/Visual/Parallel.php index 72a79090..d497eef3 100644 --- a/tests/Visual/Parallel.php +++ b/tests/Visual/Parallel.php @@ -24,13 +24,13 @@ test('parallel', function () use ($run) { $file = file_get_contents(__FILE__); $file = preg_replace( '/\$expected = \'.*?\';/', - "\$expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 27 skipped, 1312 passed (2957 assertions)';", + "\$expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 27 skipped, 1314 passed (2959 assertions)';", $file, ); file_put_contents(__FILE__, $file); } - $expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 27 skipped, 1312 passed (2957 assertions)'; + $expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 27 skipped, 1314 passed (2959 assertions)'; expect($output) ->toContain("Tests: {$expected}") From e685179b7eeb69510cc36eac154811115fe64c8b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2026 20:03:39 +0100 Subject: [PATCH 2/4] Bump actions/checkout from 6.0.3 to 7.0.0 in the github-actions group (#1737) Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 6.0.3 to 7.0.0 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/df4cb1c069e1874edd31b4311f1884172cec0e10...9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/static.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 74c97c4a..c63b6750 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -28,7 +28,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup PHP uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dbad6568..8f5eb589 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,7 +35,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup PHP uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2 From b561236325c10ddf98898072222aca7ff504435b Mon Sep 17 00:00:00 2001 From: nuno maduro Date: Thu, 25 Jun 2026 20:08:40 +0100 Subject: [PATCH 3/4] chore: bumps phpunit --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 8a6a2efc..9ba318d1 100644 --- a/composer.json +++ b/composer.json @@ -26,12 +26,12 @@ "pestphp/pest-plugin-arch": "^4.0.2", "pestphp/pest-plugin-mutate": "^4.0.1", "pestphp/pest-plugin-profanity": "^4.2.1", - "phpunit/phpunit": "^12.5.29", + "phpunit/phpunit": "^12.5.30", "symfony/process": "^7.4.13|^8.1.0" }, "conflict": { "filp/whoops": "<2.18.3", - "phpunit/phpunit": ">12.5.29", + "phpunit/phpunit": ">12.5.30", "sebastian/exporter": "<7.0.0", "webmozart/assert": "<1.11.0" }, From ee2e97e932d158faceeaa63a4dc17324b15152cb Mon Sep 17 00:00:00 2001 From: nuno maduro Date: Thu, 25 Jun 2026 20:08:52 +0100 Subject: [PATCH 4/4] release: v4.7.4 --- src/Pest.php | 2 +- .../Visual/Help/visual_snapshot_of_help_command_output.snap | 2 +- .../Visual/Version/visual_snapshot_of_help_command_output.snap | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Pest.php b/src/Pest.php index 73fa7a5a..a37c57df 100644 --- a/src/Pest.php +++ b/src/Pest.php @@ -6,7 +6,7 @@ namespace Pest; function version(): string { - return '4.7.3'; + return '4.7.4'; } 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 f2800762..b4e8e039 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 4.7.3. + Pest Testing Framework 4.7.4. USAGE: pest [options] 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 cbf2feac..8869059b 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 4.7.3. + Pest Testing Framework 4.7.4.