Open bobbingwide opened 5 years ago
Looks like we also need to change oik-batch since this implements our own version of WP_UnitTestCase which extends PHPUnit_Framework_TestCase that's been updated. It was updated in PHPUnit 7, but I've skipped a version. Keep going until you don't get messages like this.
Fatal error: Declaration of WP_UnitTestCase::tearDownAfterClass()
must be compatible with PHPUnit\Framework\TestCase::tearDownAfterClass(): void
in C:\apache\htdocs\wordpress\wp-content\plugins\oik-batch\tests\testcase.php on line 768
It seems that there are are methods in phpunit\includes files that may need updating. Alternatively, we might be able to survive without loading the files in oik-batch's test\bootstrap.php
Fatal error: Declaration of WP_Test_REST_Controller_Testcase::setUp()
must be compatible with WP_UnitTestCase::setUp(): void
in C:\apache\htdocs\wordpress\wp-content\plugins\wordpress-develop-tests\phpunit\includes\testcase-rest-controller.php on line 52
I commented out 5 of the files that produced the above message. Then I found I needed to change other oik-batch files that used setUp, tearDown, setUpBeforeClass, tearDownAfterClass etc..
The current version of PHPUnit is now 8. We need to upgrade some code in order to support this version of PHPUnit. I believe this problem has already been resolved in WordPress. See https://core.trac.wordpress.org/ticket/43218
See also #5 and #6