fix: keep the options that Pest adds before -- (#2087)

* fix: keep added options before the `--` separator

Pest added its own options (`--runner`, `--cache-directory`, `--teamcity`, `--no-coverage`, ...) after the `--` that the user gave. PHPUnit and ParaTest then read them as paths, thus `pest -- <path>` and `pest --parallel -- <path>` failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: keep every option that Pest adds before `--`

pushArgument renumbers the list before it searches `--`, because bin/pest unsets options without array_values. Coverage, Shard and the `--teamcity` handling of bin/pest now place their options before `--` too. The changed files lose their comments, as AGENTS.md section 4 asks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
This commit is contained in:
Jhon Farias
2026-12-04 10:11:42 +01:00
committed by GitHub
parent 59c1cb78f8
commit d2c1b99236
11 changed files with 73 additions and 34 deletions
+7 -1
View File
@@ -21,7 +21,7 @@ test('parallel', function () use ($run): void {
$output = implode("\n", array_slice(explode("\n", (string) $output), -10));
$profileOutput = $run('tests/Fixtures/Suites/SuccessOnly.php', '--profile');
$expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 37 skipped, 2004 passed (4168 assertions)';
$expected = '2 deprecated, 4 warnings, 5 incomplete, 3 notices, 40 todos, 37 skipped, 2005 passed (4169 assertions)';
expect($output)
->toContain("Tests: {$expected}")
@@ -162,3 +162,9 @@ test('parallel group-filtered run still fails when the selection matches no test
expect(removeAnsiEscapeSequences($process->getOutput()))->toContain('No tests found.')
->and($process->getExitCode())->toBe(1);
})->skipOnWindows();
test('parallel accepts a path after the option separator', function () use ($run): void {
expect($run('--', 'tests/Fixtures/ExampleTest.php'))
->toContain('Tests: 1 passed (1 assertions)')
->toContain('Parallel: 3 processes');
})->skipOnWindows();