Brain-WP/BrainMonkey

Support for PHPUnit 10

coreyworrell opened this issue · 3 comments

I'm running into an issue after upgrading to PHPUnit 10:

PHP Fatal error:  A never-returning function must not return in /.../vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php on line 91
Script ./vendor/bin/phpunit handling the test event returned with error code 255

I've traced it down to the line in \Brain\Monkey\setUp(): require_once dirname(__DIR__).'/inc/patchwork-loader.php'; but I haven't been able to figure out exactly what is causing the error yet.

The issue may lie with the Patchwork library, but I don't know enough about it and perhaps it is just the way that BrainMonkey uses it?

Further digging, commenting out the line in vendor/antecedent/patchwork/Patchwork.php:

CodeManipulation\register([
    // ...
    CodeManipulation\Actions\CallRerouting\injectCallInterceptionCode(),
    // ...
]);

Makes it so the error does not happen.

Hey @coreyworrell Thank you.

I was going to comment that this is either a Patchwork or Mockery issue, but it looks like you found it :)