diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 476692c2..f689e3f7 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 6db89506..649810a3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,7 +32,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/src/Pest.php b/src/Pest.php index 1aff5b90..198abae4 100644 --- a/src/Pest.php +++ b/src/Pest.php @@ -6,7 +6,7 @@ namespace Pest; function version(): string { - return '5.0.0-rc.10'; + return '5.0.0-rc.11'; } function testDirectory(string $file = ''): string diff --git a/src/Plugins/Tia.php b/src/Plugins/Tia.php index 581081af..a7d90d53 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/.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 72156a98..fd5b0c57 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 5.0.0-rc.10. + Pest Testing Framework 5.0.0-rc.11. 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 719dd9c0..f5307469 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 5.0.0-rc.10. + Pest Testing Framework 5.0.0-rc.11. diff --git a/tests/.snapshots/success.txt b/tests/.snapshots/success.txt index 7d9ce277..5b6ab145 100644 --- a/tests/.snapshots/success.txt +++ b/tests/.snapshots/success.txt @@ -517,6 +517,13 @@ ✓ pass ✓ failures ✓ failures with custom message + ✓ not failures + + PASS Tests\Features\Expect\toBeEmail + ✓ pass + ✓ failures + ✓ failures with custom message + ✓ failures with default message ✓ not failures PASS Tests\Features\Expect\toBeEmpty @@ -1756,6 +1763,18 @@ ✓ ensureFilterLengthIsSafe → it accepts filter within custom limit ✓ handleArguments → it returns original arguments when shard option is not present ✓ 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 uses singular form for single test file ✓ 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 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 @@ -1983,4 +2006,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, 1370 passed (3068 assertions) + Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 40 todos, 35 skipped, 1389 passed (3097 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 887955a8..78df799f 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, 1353 passed (3015 assertions)';", + "\$expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 27 skipped, 1372 passed (3044 assertions)';", $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) ->toContain("Tests: {$expected}")