Skip to content

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

Closed

Description

@duron01

Laravel Version

13.34.0

PHP Version

8.4.26

Database Driver & Version

MySQL 8 (not relevant)

Description

PHPUnit 13.4.0 (released 2026-10-02) changed the constructor of PHPUnit\TextUI\Configuration\PhpHandler, which now requires a PHPUnit\Event\Emitter argument:

public function __construct(Emitter $emitter)

Illuminate\Testing\Concerns\RunsInParallel still instantiates it without arguments (line 110, same on 13.x and master):

(new PhpHandler())->handle($configuration->php());

As a result, php artisan test --parallel fails immediately with an ArgumentCountError as soon as phpunit/phpunit 13.4.0 is installed. Non-parallel runs are not affected.

PHPUnit itself now calls it as new PhpHandler($this->emitter) (src/TextUI/Application.php). A possible fix keeping compatibility with PHPUnit < 13.4 would be to pass PHPUnit\Event\Facade::emitter() when the constructor has a required parameter.

Other versions: nunomaduro/collision 8.9.5, brianium/paratest 7.25.0.

Workaround for now: pin "phpunit/phpunit": "~13.3.6".

Steps To Reproduce

  1. Fresh Laravel 13.34.0 app with phpunit/phpunit 13.4.0 and brianium/paratest.
  2. Run php artisan test --parallel.
  3. ArgumentCountError: Too few arguments to function PHPUnit\TextUI\Configuration\PhpHandler::__construct(), 0 passed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions