Opened 5 weeks ago
Last modified 5 weeks ago
#65197 new enhancement
Tests: Add unit tests for wp_refresh_post_nonces()
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Administration | Keywords: | has-patch has-unit-tests |
| Focuses: | Cc: |
Description
This ticket adds comprehensive unit tests for the wp_refresh_post_nonces() function in wp-admin/includes/misc.php. These tests ensure that the function correctly returns refreshed nonces for post locking and unlocking when appropriate Heartbeat data is provided and the user has the necessary permissions.
Change History (1)
This ticket was mentioned in PR #11757 on WordPress/wordpress-develop by @pbearne.
5 weeks ago
#1
- Keywords has-patch has-unit-tests added
Note: See
TracTickets for help on using
tickets.
….php
Description:
This PR adds unit tests for the
wp_refresh_post_nonces()function inwp-admin/includes/misc.php. These tests ensure that the function correctly refreshes post-related nonces (likegetpermalinknonce,_wpnonce, etc.) during Heartbeat requests, while verifying user permissions and handling invalid post IDs.The tests cover:
post_idparameter (zero, string, non-numeric).getpermalinknonce,samplepermalinknonce,closedpostboxesnonce,_ajax_linking_nonce, and_wpnonce) when authorized.Trac ticket: https://core.trac.wordpress.org/ticket/65197
AI Disclosure: