Skip to content

[13.x] Fix parallel testing with PHPUnit 13.4 - #61859

Merged
taylorotwell merged 1 commit into
laravel:13.xfrom
lazerg:fix/issue-61857-parallel-php-handler
Oct 5, 2026
Merged

taylorotwell merged 1 commit into
laravel:13.xfrom
lazerg:fix/issue-61857-parallel-php-handler

Conversation

@lazerg

@lazerg lazerg commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

PHPUnit 13.4 added a required Emitter argument to PhpHandler's constructor, so php artisan test --parallel now fails with an ArgumentCountError before any test runs.

This passes PHPUnit\Event\Facade::emitter(), which is what PHPUnit itself hands it. Older PHPUnit versions have no constructor on PhpHandler, so the extra argument is ignored there and 11.x/12.x keep working as before.

Fixes #61857

: $this->options->configuration();

(new PhpHandler())->handle($configuration->php());
(new PhpHandler(EventFacade::emitter()))->handle($configuration->php());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't this failed on PHPUnit 13.3 and below?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't. PhpHandler has no constructor before 13.4, so PHP just ignores the extra argument. I checked it on 13.3.6, and 11.5 and 12.5 don't have one either.

@taylorotwell
taylorotwell merged commit 4754018 into laravel:13.x Oct 5, 2026
62 checks passed
cursor Bot pushed a commit to DevanB/kibbles that referenced this pull request Oct 10, 2026
Laravel 13.34 still constructs PhpHandler with no arguments. The official fix is 13.35 (laravel/framework#61859), which this repo cannot take until Wayfinder accepts QUERY. Temporarily classmap Illuminate\Testing\ParallelRunner to Laravel's one-line emitter fix so the existing test:unit command keeps working.

Co-authored-by: Devan <[email protected]>
DevanB added a commit to DevanB/kibbles that referenced this pull request Oct 10, 2026
Laravel 13.34 still constructs PhpHandler with no arguments. The official fix is 13.35 (laravel/framework#61859), which this repo cannot take until Wayfinder accepts QUERY. Temporarily classmap Illuminate\Testing\ParallelRunner to Laravel's one-line emitter fix so the existing test:unit command keeps working.

Co-authored-by: Devan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[13.x] artisan test --parallel broken with PHPUnit 13.4: PhpHandler requires Emitter

3 participants