Opened 5 weeks ago
Last modified 5 weeks ago
#65198 new enhancement
Tests: Add unit tests for wp_refresh_metabox_loader_nonces()
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Administration | Keywords: | has-patch has-unit-tests |
| Focuses: | tests | Cc: |
Description
This ticket adds comprehensive unit tests for the wp_refresh_metabox_loader_nonces() function in wp-admin/includes/misc.php. These tests ensure that the function correctly returns refreshed nonces (meta-box-loader and update-post_{$post_id}) when valid data is provided and the user has edit permissions.
Change History (2)
This ticket was mentioned in PR #11758 on WordPress/wordpress-develop by @pbearne.
5 weeks ago
#2
- Keywords has-patch has-unit-tests added
Note: See
TracTickets for help on using
tickets.
…ludes/misc.php
Description:
This PR adds unit tests for the
wp_refresh_metabox_loader_nonces()function inwp-admin/includes/misc.php. These tests ensure that the function correctly refreshes nonces used for meta boxes in the block editor during Heartbeat requests, while verifying user permissions and handling invalid post IDs.The tests cover:
post_idparameter (zero, string, non-numeric).metabox_loader_nonceand_wpnoncewhen authorized.Trac ticket: https://core.trac.wordpress.org/ticket/65198
AI Disclosure: