Repository navigation
Conversation
Co-authored-by: Junie <junie@jetbrains.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @junie-agent. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. Core Committers: Use this line as a base for the props when committing in SVN: 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:
|
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
There was a problem hiding this comment.
🟡 Changes recommended
The invalid-item AJAX tests can pass despite nonempty wp_die() errors because they do not assert that the caught exception messages are empty.
1 open issue
What changed in this PR
Adds unit tests for WordPress’s wp_ajax_menu_get_metabox() handler without changing production code.
Changes:
- Covers successful post type and taxonomy metabox retrieval.
- Checks rejection of users without sufficient permissions.
- Exercises invalid
item-typeanditem-objectinputs.
| File | Description |
|---|---|
tests/phpunit/tests/admin/includes/ajax-actions/menuGetMetabox.php |
Adds fixtures and five tests covering metabox retrieval, permissions, and invalid inputs. |
Review effort: Balanced
| } catch ( WPAjaxDieStopException $e ) { | ||
| // We expect it to die without outputting anything if item-type is invalid. |
lancewillett
left a comment
There was a problem hiding this comment.
Post-type, taxonomy, and permission checks cover distinct behavior. The unused post fixture is optional cleanup. This PR's cases passed in the supplied local single-site and multisite runs. Current CI is not verified green; this is code approval only.
AI review · gpt-6
|
@pbearne The patch passes local randomized PHPUnit checks against current trunk in single-site and multisite, plus PHP lint and coding standards. The remaining failed checks are from June. Their logs have expired, and GitHub rejected a job rerun because the run is over a month old. I cannot establish the cause from the retained metadata. Could you refresh this branch against trunk to produce a current CI run before landing? AI review · |
Verify menu metabox output and saved menu locations, dismissed pointers, fullscreen post updates, and post-lock ownership and expiry. Cover relevant permission and nonce rejection paths. Developed in: #11897, #11899, #12138 Props pbearne, ugyensupport. See #65252. git-svn-id: https://develop.svn.wordpress.org/trunk@65152 602fd350-edb4-49c9-b593-d223f7449a82
Verify menu metabox output and saved menu locations, dismissed pointers, fullscreen post updates, and post-lock ownership and expiry. Cover relevant permission and nonce rejection paths. Developed in: WordPress/wordpress-develop#11897, WordPress/wordpress-develop#11899, WordPress/wordpress-develop#12138 Props pbearne, ugyensupport. See #65252. Built from https://develop.svn.wordpress.org/trunk@65152 git-svn-id: http://core.svn.wordpress.org/trunk@64301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
|
PR #11897 landed in https://core.trac.wordpress.org/changeset/65152 |

This PR adds unit tests for the
wp_ajax_menu_get_metabox()function located insrc/wp-admin/includes/ajax-actions.php.The tests cover:
edit_theme_optionscapability).item-typeanditem-object).Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure: