Skip to content

PHPUnit 12.3.4 changed ErrorHandler contract and Laravel needs to be updated #56627

@alexey-m-ukolov

Description

@alexey-m-ukolov

Laravel Version

12.22.1

PHP Version

8.4.2

Database Driver & Version

No response

Description

PHPUnit 12.3.4 includes sebastianbergmann/phpunit@83f6449 where ErrorHandle::enable() now expects TestCase object but it is not provided in Illuminate\Foundation\Bootstrap\HandleExceptions::flushHandlersState(). So we get an error when running tests:

ArgumentCountError: Too few arguments to function PHPUnit\Runner\ErrorHandler::enable(), 0 passed in /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php on line 358 and exactly 1 expected

Steps To Reproduce

Update Laravel and PHPUnit to the specified versions and run any test using PHPUnit.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions