Opened 4 months ago
Last modified 4 months ago
#65198 new enhancement
Tests: Add unit tests for wp_refresh_metabox_loader_nonces()
| Reported by: | pbearne | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Administration | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: | tests |
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.
4 months ago
#2
- Keywords has-patch has-unit-tests added
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
…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: