orchestral/testbench

Testbench not compatible with PHPUnit 8

Closed this issue · 7 comments

mfn commented

PHP Fatal error: Declaration of Orchestra\Testbench\TestCase::setUp() must be compatible with PHPUnit\Framework\TestCase::setUp(): void in /…/laravel-framework/vendor/orchestra/testbench-core/src/TestCase.php on line 15

PHPUnit 8 introduced return type : void it's TestCase class, like setUp, tearDown, etc. which all have to be adapted.

This changes will only happen after Laravel start migrating/upgrading to PHPUnit 8

mfn commented

I figured so, it just looked like a chicken/egg thing that when I locally updated the test unit I couldn't really do it because the dependency doesn't work 😄

laravel/framework#26457 (comment)

We want to avoid things like this from happening again.

mfn commented

Hey thanks! :feelsbad:

Laravel can't upgrade because Taylor wants to keep php 7.1 compatibility in the 5.8 release. So, I guess Laravel will not support phpunit 8 until laravel 5.9.

I did see this issue coming 5 months ago (1st August 2018), and suggested Laravel 5.8 switched to PHP 7.2+, but no. 🤷‍♀️

Both PHPUnit 7 and 8 can be supported. Sent in a PR here: orchestral/testbench-core#18