From d472b34c892acf72e79eb74c2b85c2f8f6412ef7 Mon Sep 17 00:00:00 2001 From: hellofromTonya Date: Tue, 23 Nov 2021 18:57:00 +0000 Subject: [PATCH] Build/Test Tools: Fix warnings from `stdClass::__invoke()` callback mocks in REST API tests. When running core tests on PHPUnit 8.x and 9.x, four non-blocking warnings were displayed for the REST API tests: {{{ There were 4 warnings: 1) Tests_REST_Request::test_route_level_validate_callback createPartialMock called with method(s) __invoke that do not exist in stdClass. This will not be allowed in future versions of PHPUnit. 2) Tests_REST_Request::test_route_level_validate_callback_no_parameter_callbacks createPartialMock called with method(s) __invoke that do not exist in stdClass. This will not be allowed in future versions of PHPUnit. 3) Tests_REST_Request::test_route_level_validate_callback_is_not_executed_if_parameter_validation_fails createPartialMock called with method(s) __invoke that do not exist in stdClass. This will not be allowed in future versions of PHPUnit. 4) Tests_REST_Server::test_callbacks_are_not_executed_if_request_validation_fails createPartialMock called with method(s) __invoke that do not exist in stdClass. This will not be allowed in future versions of PHPUnit. }}} These warnings are due to the PHP native `stdClass` not having a `__invoke()` method declared. This commit adds a `Mock_Invokable` reusable class and replaces the `stdClass` with this new class. Follow-up to [48945], [48947]. Props sourovroy, jrf. Fixes #53844. Built from https://develop.svn.wordpress.org/trunk@52235 git-svn-id: http://core.svn.wordpress.org/trunk@51827 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/version.php b/wp-includes/version.php index 6e5823be4b..373abe39d2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-52234'; +$wp_version = '5.9-alpha-52235'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.