Opened 5 weeks ago
Last modified 5 weeks ago
#65196 new enhancement
Tests: Add unit tests for wp_refresh_post_lock()
| 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_lock() function in wp-admin/includes/misc.php. These tests ensure that the function correctly updates the post lock, handles invalid post IDs, and returns the appropriate Heartbeat response data (including updated lock and nonces if necessary).
Change History (1)
This ticket was mentioned in PR #11756 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.
Description:
This PR adds unit tests for the
wp_refresh_post_lock()function inwp-admin/includes/misc.php. These tests ensure that the function correctly refreshes the post lock during Heartbeat requests, handles cases where the post is locked by another user, and verifies that the current user has the necessary permissions.The tests cover:
post_idparameter (zero, string, negative).lock_errorwhen the post is locked by another user, including optional avatar URLs.new_lockvalue.Trac ticket: https://core.trac.wordpress.org/ticket/65196
AI Disclosure: