Tests: Require PHPUnit >= 6 in tests using ::createPartialMock().

This avoids a "Call to undefined method" fatal error when running the tests with PHPUnit 5.4.x, which WordPress still supports as the minimum version.

Follow-up to [48945], [48947].

See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@51226 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2021-06-24 10:04:41 +00:00
parent 735ecc0ba9
commit f5ae410c33
2 changed files with 4 additions and 0 deletions

View File

@ -1008,6 +1008,7 @@ class Tests_REST_Request extends WP_UnitTestCase {
/**
* @ticket 51255
* @requires PHPUnit >= 6
*/
public function test_route_level_validate_callback() {
$request = new WP_REST_Request();
@ -1032,6 +1033,7 @@ class Tests_REST_Request extends WP_UnitTestCase {
/**
* @ticket 51255
* @requires PHPUnit >= 6
*/
public function test_route_level_validate_callback_no_parameter_callbacks() {
$request = new WP_REST_Request();
@ -1051,6 +1053,7 @@ class Tests_REST_Request extends WP_UnitTestCase {
/**
* @ticket 51255
* @requires PHPUnit >= 6
*/
public function test_route_level_validate_callback_is_not_executed_if_parameter_validation_fails() {
$request = new WP_REST_Request();

View File

@ -1571,6 +1571,7 @@ class Tests_REST_Server extends WP_Test_REST_TestCase {
/**
* @ticket 50244
* @requires PHPUnit >= 6
*/
public function test_callbacks_are_not_executed_if_request_validation_fails() {
$callback = $this->createPartialMock( 'stdClass', array( '__invoke' ) );