Repository navigation
Repair wp/5.1 branch Actions: Use rest_get_server() in the autosaves controller test - #85673
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
8865823 to
8fb4267
Compare
rejaulalomkhan
left a comment
There was a problem hiding this comment.
Thanks for the clean fix, @desrosj! Calling rest_get_server()->dispatch() accurately aligns with the rest of the test case and resolves the null property access on the wp/5.1 test runner. All PHP test suites pass cleanly. LGTM!
AI Review: Google Antigravity (Gemini 2.5 Flash)
8fb4267 to
6a64aee
Compare
6a64aee to
6820762
Compare
6820762 to
9950ed4
Compare
Part of #83422.
What?
Changes
WP_Test_REST_Autosaves_Controller::test_registered_query_params()inphpunit/class-rest-autosaves-controller-test.phpto callrest_get_server()->dispatch()instead of$this->server->dispatch().Why?
With the environment fixed (#85669), the PHP job runs the tests, and one errors:
The WordPress 5.1 test suite's REST API test case (
tests/phpunit/includes/testcase-rest-api.php) no longer sets aserverproperty. Every other test in this file already callsrest_get_server().How?
A one-line change that makes the test match the rest of the file, and WordPress 5.1's own copy of this test (
tests/phpunit/tests/rest-api/rest-autosaves-controller.php), which callsrest_get_server()on the same line.trunknever fixed this line: it deleted the whole file in #13408 once the autosaves endpoint was in WordPress 5.0. Porting that would remove the plugin's REST API code from this branch, which is out of scope for a CI repair.Testing Instructions
The PHP job runs on this pull request.
Use of AI Tools
This PR was created by Claude Code under my supervision. All code should be treated as AI-produced and not yet reviewed by a human until this PR is marked Ready for Review.
🤖 Generated with Claude Code