Opened 4 weeks ago
Last modified 7 days ago
#65252 new enhancement
Test Progress: src/wp-admin/includes/ajax-actions.php
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Administration | Keywords: | has-patch has-unit-tests |
| Focuses: | tests | Cc: |
Description (last modified by )
Test Progress: src/wp-admin/includes/ajax-actions.php
This file tracks the status of unit tests for functions in src/wp-admin/includes/ajax-actions.php.
Completed Functions (Tests Found)
| Function | Status |
|---|---|
| wp_ajax_ajax_tag_search | ✅ Found |
| wp_ajax_wp_compression_test | ✅ Found |
| _wp_ajax_delete_comment_response | ✅ Found |
| wp_ajax_delete_comment | ✅ Found |
| wp_ajax_dim_comment | ✅ Found |
| wp_ajax_add_tag | ✅ Found |
| wp_ajax_get_comments | ✅ Found |
| wp_ajax_replyto_comment | ✅ Found |
| wp_ajax_edit_comment | ✅ Found |
| wp_ajax_add_meta | ✅ Found |
| wp_ajax_inline_save | ✅ Found |
| wp_ajax_image_editor | ✅ Found |
| wp_ajax_set_attachment_thumbnail | ✅ Found |
| wp_ajax_send_attachment_to_editor | ✅ Found |
| wp_ajax_heartbeat | ✅ Found |
| wp_ajax_crop_image | ✅ Found |
| wp_ajax_update_theme | ✅ Found |
| wp_ajax_update_plugin | ✅ Found |
| wp_ajax_delete_plugin | ✅ Found |
| wp_ajax_wp_privacy_export_personal_data | ✅ Found |
| wp_ajax_wp_privacy_erase_personal_data | ✅ Found |
| wp_ajax_parse_media_shortcode | ✅ Found |
These tests were moved to tests/phpunit/tests/admin/includes/ajax-actions in ticket 65226.
Missing Functions (Tests Not Found)
| Function | Status | Ticket | Pull Request | Committed |
|---|---|---|---|---|
| wp_ajax_nopriv_heartbeat | created | ✅ #65236 | 65236-ajax-actions-wp_ajax_nopriv_heartbeat | |
| wp_ajax_fetch_list | created | ✅ #65237 | 65237-ajax-actions-wp_ajax_fetch_list | |
| wp_ajax_imgedit_preview | created | #65252 | 11845 | |
| wp_ajax_oembed_cache | created | #65252 | 11846 | |
| wp_ajax_autocomplete_user | created | #65252 | 11866 | |
| wp_ajax_get_community_events | created | #65252 | 11867 | |
| wp_ajax_dashboard_widgets | created | #65252 | 11869 | |
| wp_ajax_logged_in | created | ✅ #65242 | 65242-ajax-actions-wp_ajax_logged_in | |
| _wp_ajax_add_hierarchical_term | created | #65252 | 11871 | |
| wp_ajax_delete_tag | created | #65252 | 11870 | |
| wp_ajax_delete_link | created | #65252 | 11872 | |
| wp_ajax_delete_meta | created | #65252 | 11873 | |
| wp_ajax_delete_post | created | #65252 | 11874 | |
| wp_ajax_trash_post | created | #65252 | 11875 | |
| wp_ajax_untrash_post | created | #65252 | 11876 | |
| wp_ajax_delete_page | created | #65252 | 11877 | |
| wp_ajax_add_link_category | created | #65252 | 11878 | |
| wp_ajax_get_tagcloud | created | #65252 | 11879 | |
| wp_ajax_add_menu_item | created | #65252 | 11880 | |
| wp_ajax_add_user | created | #65252 | 11881 | |
| wp_ajax_closed_postboxes | created | #65252 | 11882 | |
| wp_ajax_hidden_columns | created | #65252 | 11895 | |
| wp_ajax_update_welcome_panel | created | #65252 | 11896 | |
| wp_ajax_menu_get_metabox | created | #65252 | 11897 | |
| wp_ajax_wp_link_ajax | created | #65252 | 11898 | |
| wp_ajax_menu_locations_save | created | #65252 | 11899 | |
| wp_ajax_meta_box_order | created | #65252 | 11900 | |
| wp_ajax_menu_quick_search | created | #65252 | 11901 | |
| wp_ajax_get_permalink | created | #65252 | 11906 | |
| wp_ajax_sample_permalink | created | #65252 | 11907 | |
| wp_ajax_inline_save_tax | created | #65252 | 11908 | |
| wp_ajax_find_posts | created | #65252 | 11909 | |
| wp_ajax_widgets_order | created | #65341 | 11963 | |
| wp_ajax_save_widget | created | #65252 | 12075 | |
| wp_ajax_update_widget | created | #65252 | 12076 | |
| wp_ajax_delete_inactive_widgets | created | #65252 | 12090 | |
| wp_ajax_media_create_image_subsizes | created | #65252 | 12092 | |
| wp_ajax_upload_attachment | created | #65252 | 12092 | |
| wp_ajax_set_post_thumbnail | created | #65252 | 12091 | |
| wp_ajax_get_post_thumbnail_html | created | #65252 | 12091 | |
| wp_ajax_date_format | created | ✅ #65225 | 65225-ajax-date_format | |
| wp_ajax_time_format | created | ✅ #65228 | 65228-ajax-time_format | |
| wp_ajax_wp_fullscreen_save_post | created | #65252 | 12138 | |
| wp_ajax_wp_remove_post_lock | created | #65252 | 12138 | |
| wp_ajax_dismiss_wp_pointer | created | #65252 | 12138 | |
| wp_ajax_get_attachment | created | #65252 | 12093 | |
| wp_ajax_query_attachments | created | #65252 | 12093 | |
| wp_ajax_save_attachment | created | #65252 | 12096 | |
| wp_ajax_save_attachment_compat | created | #65252 | 12094 | |
| wp_ajax_save_attachment_order | created | #65252 | 12095 | |
| wp_ajax_send_attachment_to_editor | created | #65252 | 12095 | |
| wp_ajax_get_revision_diffs | created | #65252 | 12097 | |
| wp_ajax_send_link_to_editor | created | #65252 | 12097 | |
| wp_ajax_save_user_color_scheme | created | #65252 | 12098 | |
| wp_ajax_query_themes | created | #65252 | 12128 | |
| wp_ajax_parse_embed | created | #65252 | 12128 | |
| wp_ajax_destroy_sessions | created | #65252 | 12128 | |
| wp_ajax_generate_password | created | #65252 | 12129 | |
| wp_ajax_nopriv_generate_password | created | #65252 | 12129 | |
| wp_ajax_save_wporg_username | created | #65252 | 12129 | |
| wp_ajax_install_theme | created | #65252 | 12129 | |
| wp_ajax_delete_theme | created | #65252 | 12129 | |
| wp_ajax_install_plugin | created | #65252 | 12129 | |
| wp_ajax_activate_plugin | created | #65252 | 12129 | |
| wp_ajax_search_plugins | created | #65252 | 12129 | |
| wp_ajax_search_install_plugins | created | #65252 | 12129 | |
| wp_ajax_edit_theme_plugin_file | created | #65252 | 12129 | |
| wp_ajax_health_check_dotorg_communication | created | #65252 | 12130 | |
| wp_ajax_health_check_background_updates | created | #65252 | 12130 | |
| wp_ajax_health_check_loopback_requests | created | #65252 | 12130 | |
| wp_ajax_health_check_site_status_result | created | #65252 | 12130 | |
| wp_ajax_health_check_get_sizes | created | #65252 | 12130 | |
| wp_ajax_rest_nonce | created | ✅ #65243 | 11837 | |
| wp_ajax_toggle_auto_updates | created | #65252 | 12130 | |
| wp_ajax_send_password_reset | created | #65252 | 12130 |
Change History (61)
This ticket was mentioned in PR #11845 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#2
- Keywords has-patch has-unit-tests added
This ticket was mentioned in PR #11846 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#4
- Keywords has-patch has-unit-tests added
This PR adds unit tests for the wp_ajax_oembed_cache() function, which handles oEmbed caching via AJAX.
The tests cover:
- Successful trigger of oEmbed caching for a post.
- Handling of invalid post IDs (should still exit with 0 as per implementation).
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11866 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#7
- Keywords has-patch has-unit-tests added
This PR adds unit tests for the wp_ajax_autocomplete_user() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Searching for users by login.
- Searching for users by email.
- Adding users to a site (which should exclude existing members).
- Non-member inclusion when adding users.
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11867 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#8
This PR adds unit tests for the wp_ajax_get_community_events() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful retrieval of community events with mocked API response.
- Proper handling of API errors (e.g., non-200 response codes).
- Nonce validation for security.
- Verification of user meta update for saved location.
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11869 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#9
This PR adds unit tests for the wp_ajax_dashboard_widgets() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful retrieval of community events with mocked API response.
- Proper handling of API errors (e.g., non-200 response codes).
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11870 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#11
This PR adds unit tests for the wp_ajax_delete_tag() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful deletion of tags (post_tag).
- Successful deletion of categories.
- Proper handling of invalid nonces.
- Verification of user permissions (delete_term capability).
- Behavior when attempting to delete a non-existent tag ID.
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11871 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#12
This PR adds unit tests for the _wp_ajax_add_hierarchical_term() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful creation of hierarchical terms (e.g., categories).
- Creation of child terms with a specified parent.
- Adding multiple terms at once (comma-separated).
- Nonce validation for security.
- Verification of user permissions (edit_terms capability).
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11872 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#13
This PR adds unit tests for the wp_ajax_delete_link() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful deletion of links (bookmarks).
- Proper handling of invalid nonces.
- Verification of user permissions (
manage_linkscapability). - Behavior when attempting to delete a non-existent link ID (idempotent success).
Note: The tests enable the link_manager_enabled option to allow the manage_links capability to be correctly checked, as the Link Manager is disabled by default in modern WordPress.
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11873 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#14
This PR adds unit tests for the wp_ajax_delete_meta() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful deletion of post metadata.
- Proper handling of invalid nonces.
- Verification of user permissions (
delete_post_metacapability). - Prevention of deleting protected meta keys (keys starting with
_). - Behavior when attempting to delete a non-existent meta ID (idempotent success).
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11874 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#15
This PR adds unit tests for the wp_ajax_delete_post() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful deletion of posts (when they are already in the trash).
- Proper handling of invalid nonces.
- Verification of user permissions (
delete_postcapability). - Behavior when attempting to delete a non-existent post ID.
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11875 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#16
This PR adds unit tests for the wp_ajax_trash_post() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful trashing of posts.
- Proper handling of invalid nonces.
- Verification of user permissions (
delete_postcapability). - Behavior when attempting to trash a non-existent post ID (verified that permission check fails first).
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11876 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#17
This PR adds unit tests for the wp_ajax_untrash_post() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful untrashing of posts (restoring from trash).
- Proper handling of invalid nonces.
- Verification of user permissions (
delete_postcapability). - Behavior when attempting to untrash a non-existent post ID.
The tests use the $factory = self::factory(); pattern to access the unit test factory.
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11877 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#18
This PR adds unit tests for the wp_ajax_delete_page() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful permanent deletion of pages (when they are already in the trash).
- Proper handling of invalid nonces.
- Verification of user permissions (
delete_pagecapability). - Behavior when attempting to delete a non-existent page ID.
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11878 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#19
This PR adds unit tests for the wp_ajax_add_link_category() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful addition of a single link category.
- Successful addition of multiple comma-separated link categories.
- Proper handling of invalid nonces.
- Verification of user permissions (
manage_termscapability forlink_categorytaxonomy). - Behavior when attempting to add an empty category name.
Note: The tests enable the link_manager_enabled option and re-run taxonomy initialization to ensure the link_category taxonomy is available for testing.
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11879 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#20
This PR adds unit tests for the wp_ajax_get_tagcloud() function located in src/wp-admin/includes/ajax-actions.php. The tests cover:
- Successful generation of a tag cloud for a given taxonomy.
- Proper handling of missing or invalid taxonomy parameters.
- Verification of user permissions (edit_posts capability).
Behavior when no terms are found for the requested taxonomy.
The tests ensure that the function returns the expected HTML for the tag cloud or the appropriate error/empty messages based on the input and environment.
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, file management, and workflow orchestration.
This ticket was mentioned in PR #11880 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#21
This PR adds unit tests for the wp_ajax_add_menu_item() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful addition of custom menu items (links).
- Successful addition of post-based menu items (e.g., pages).
- Proper handling of invalid nonces.
- Verification of user permissions (
edit_theme_optionscapability).
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11881 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#22
This PR adds unit tests for the wp_ajax_add_user() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful creation of a new user via AJAX.
- Proper handling of invalid nonces.
- Verification of user permissions (
create_userscapability). - Behavior when
edit_user()returns aWP_Error(e.g., invalid email address).
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11882 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#23
This PR adds unit tests for the wp_ajax_closed_postboxes() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful update of closed and hidden postboxes for a given page.
- Proper handling of invalid nonces.
- Verification of page key sanitization (rejection of invalid keys).
- Ensuring that protected postboxes (e.g.,
submitdiv) are not hidden.
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11895 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#25
This PR adds unit tests for the wp_ajax_hidden_columns() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful update of hidden columns in user meta.
- Proper handling of invalid nonces.
- Validation of the page parameter (ensuring it passes
sanitize_key). - Correct behavior when the
hiddenparameter is empty.
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11896 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#26
This PR adds unit tests for the wp_ajax_update_welcome_panel() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful update of the welcome panel visibility (both showing and hiding).
- Proper handling of invalid nonces.
- Verification of user permissions (
edit_theme_optionscapability).
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11897 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#27
This PR adds unit tests for the wp_ajax_menu_get_metabox() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful retrieval of post type metaboxes (e.g., for 'post').
- Successful retrieval of taxonomy metaboxes (e.g., for 'category').
- Proper handling of insufficient user permissions (verification of
edit_theme_optionscapability). - Validation of input parameters (
item-typeanditem-object).
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11898 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#28
This PR adds unit tests for the wp_ajax_wp_link_ajax() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful internal link searching using the
searchPOST parameter. - Successful internal link searching using the
termPOST parameter. - Proper handling of pagination through the
pageparameter. - Validation of AJAX nonces (
_ajax_linking_nonce). - Behavior when no results are found (ensuring it dies with
0).
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11899 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#29
This PR adds unit tests for the wp_ajax_menu_locations_save() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful saving of menu locations in theme modifications.
- Proper handling of invalid nonces (
add-menu_itemnonce). - Verification of user permissions (
edit_theme_optionscapability). - Correct behavior when the
menu-locationsparameter is missing.
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11900 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#30
This PR adds unit tests for the wp_ajax_meta_box_order() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful update of meta box order in user meta.
- Successful update of screen layout (page columns), including the 'auto' value.
- Proper handling of invalid nonces.
- Validation of the page parameter (ensuring it passes
sanitize_key). - Behavior when no user is logged in (ensuring it dies with
-1).
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11901 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#31
This PR adds unit tests for the wp_ajax_menu_quick_search() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful retrieval of post items by ID in JSON format.
- Successful retrieval of post items by ID in markup format (HTML).
- Successful retrieval of taxonomy terms by ID in JSON format.
- Successful search for menu items using a search query (q parameter).
- Proper handling of insufficient user permissions (verification of
edit_theme_optionscapability).
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11906 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#32
This PR adds unit tests for the wp_ajax_get_permalink() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful retrieval of a post permalink.
- Proper handling of invalid nonces (
getpermalinknonce). - Behavior when the
post_idparameter is missing.
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11907 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#33
This PR adds unit tests for the wp_ajax_sample_permalink() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful retrieval of a sample permalink HTML with custom title and slug.
- Proper handling of invalid nonces (
samplepermalinknonce). - Correct behavior when using default inputs (missing
new_titleornew_slug).
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11908 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#34
This PR adds unit tests for the wp_ajax_inline_save_tax() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful update of a term via Quick Edit.
- Proper handling of invalid nonces (
taxinlineeditnonce). - Validation of the taxonomy parameter.
- Behavior when the
tax_IDparameter is missing. - Verification of user permissions (
edit_termcapability).
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11909 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#35
This PR adds unit tests for the wp_ajax_find_posts() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful post searching using the
psPOST parameter. - Proper handling of invalid nonces (
find-postsnonce). - Behavior when no results are found (ensuring it returns a JSON error).
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11910 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#36
This PR adds unit tests for the wp_ajax_inline_save() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful Quick Edit save for both posts and pages.
- Proper handling of invalid nonces (
inlineeditnonce). - Behavior when the
post_IDparameter is missing. - Verification of user permissions (
edit_postandedit_pagecapabilities). - Correct behavior when a post is locked by another user.
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #11911 on WordPress/wordpress-develop by @pbearne.
4 weeks ago
#37
This PR adds unit tests for the wp_ajax_widgets_order() function located in src/wp-admin/includes/ajax-actions.php.
The tests cover:
- Successful saving of the widgets order for multiple sidebars.
- Proper handling of invalid nonces (
save-sidebar-widgetsnonce). - Verification of user permissions (
edit_theme_optionscapability). - Behavior when the
sidebarsparameter is missing.
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
@pbearne commented on PR #11910:
4 weeks ago
#38
already tested
@pbearne commented on PR #11911:
3 weeks ago
#41
move to https://github.com/WordPress/wordpress-develop/pull/11963
As a change, the function was needed
@orionaselite commented on PR #11907:
2 weeks ago
#42
Tested PR #11907 locally against current trunk.
Environment:
- WordPress develop at 7.1-alpha-src
- PHP 8.3.31 in the Docker local environment
- MySQL 9.7 Docker service
- PHPUnit 9.6.34
Results:
- Targeted Ajax tests for the new class pass:
- npm run test:php -- --group ajax --filter Tests_wp_ajax_sample_permalink
- Result: 3 tests, 5 assertions
- PHPCS passes for the new test file:
- vendor/bin/phpcs --standard=phpcs.xml.dist tests/phpunit/tests/admin/includes/ajax-actions/samplePermalink.php
The added coverage for wp_ajax_sample_permalink() looks good from this local test pass.
This ticket was mentioned in PR #12075 on WordPress/wordpress-develop by @pbearne.
12 days ago
#43
This PR adds unit tests for the wp_ajax_save_widget() function in src/wp-admin/includes/ajax-actions.php, covering successful widget deletion, adding new multi-widgets, and various failure scenarios (invalid nonce, insufficient permissions, missing parameters).
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management
This ticket was mentioned in PR #12076 on WordPress/wordpress-develop by @pbearne.
12 days ago
#44
This PR adds unit tests for the wp_ajax_update_widget() function in src/wp-admin/includes/ajax-actions.php, which delegates to the Customizer's widget update mechanism. The tests cover validation of the AJAX nonce, handling of missing widget IDs, and rejection of template widget updates.
•
Trac ticket: https://core.trac.wordpress.org/ticket/65252
•
AI Disclosure:
◦
AI assistance: Yes
◦
Tool(s): Junie (JetBrains)
◦
Model(s): gemini-3-flash-preview
◦
Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #12090 on WordPress/wordpress-develop by @pbearne.
12 days ago
#46
This PR adds unit tests for the wp_ajax_delete_inactive_widgets() function in src/wp-admin/includes/ajax-actions.php. The tests cover the successful removal of widgets from the inactive widgets sidebar (and their corresponding options), as well as failure cases for invalid AJAX nonces and insufficient user permissions.
- Trac ticket: https://core.trac.wordpress.org/ticket/65252
- AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #12091 on WordPress/wordpress-develop by @pbearne.
12 days ago
#47
This PR adds unit tests for wp_ajax_set_post_thumbnail() and wp_ajax_get_post_thumbnail_html() in src/wp-admin/includes/ajax-actions.php. The tests cover setting and removing featured images using both traditional and JSON-based requests, as well as permission and nonce validation.
- Trac ticket: https://core.trac.wordpress.org/ticket/65252
- AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and verification.
This ticket was mentioned in PR #12092 on WordPress/wordpress-develop by @pbearne.
12 days ago
#48
…onality
This PR adds unit tests for wp_ajax_media_create_image_subsizes() and wp_ajax_upload_attachment() in src/wp-admin/includes/ajax-actions.php. The tests cover successful image sub-size generation, attachment uploading with mocked filesystem checks, and various error conditions including invalid nonces and insufficient permissions.
- Trac ticket: https://core.trac.wordpress.org/ticket/65252
- AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and complex mocking of internal WordPress functions.
This ticket was mentioned in PR #12093 on WordPress/wordpress-develop by @pbearne.
12 days ago
#49
Ajax: Add tests for attachment retrieval and querying
- Description: This PR adds unit tests for
wp_ajax_get_attachment()andwp_ajax_query_attachments()insrc/wp-admin/includes/ajax-actions.php. The tests cover successful data retrieval, search functionality, and error handling for permissions and invalid inputs.
- Trac ticket: https://core.trac.wordpress.org/ticket/65252
- AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and debugging environment-specific AJAX test behavior.
This ticket was mentioned in PR #12094 on WordPress/wordpress-develop by @pbearne.
12 days ago
#50
…achment_compat`.
This PR reorganizes the AJAX unit tests for several media and widget handlers. Each AJAX call now has its own dedicated test class and file, improving maintainability and following the requested project structure.
- Trac ticket: https://core.trac.wordpress.org/ticket/65252
- AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code refactoring, test organization, and verification.
This ticket was mentioned in PR #12095 on WordPress/wordpress-develop by @pbearne.
11 days ago
#51
This PR adds unit tests for wp_ajax_save_attachment_order() and wp_ajax_send_attachment_to_editor() in src/wp-admin/includes/ajax-actions.php. The tests cover updating the menu order of multiple attachments, generating HTML for editor insertion (for both images and other files), and validating nonces and permissions.
- Trac ticket: https://core.trac.wordpress.org/ticket/65252
- AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and verification.
This ticket was mentioned in PR #12096 on WordPress/wordpress-develop by @pbearne.
11 days ago
#52
This PR adds unit tests for wp_ajax_save_attachment() in src/wp-admin/includes/ajax-actions.php. The tests cover updating the menu order of multiple attachments, generating HTML for editor insertion (for both images and other files), and validating nonces and permissions.
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
AI assistance: Yes
Tool(s): Junie (JetBrains)
Model(s): gemini-3-flash-preview
Used for: Code analysis, test implementation, and verification.
This ticket was mentioned in PR #12097 on WordPress/wordpress-develop by @pbearne.
11 days ago
#53
…p_ajax_send_link_to_editor`.
This PR adds unit tests for wp_ajax_get_revision_diffs() and wp_ajax_send_link_to_editor() in src/wp-admin/includes/ajax-actions.php. The tests cover updating the menu order of multiple attachments, generating HTML for editor insertion (for both images and other files), and validating nonces and permissions.
Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure:
AI assistance: Yes
Tool(s): Junie (JetBrains)
Model(s): gemini-3-flash-preview
Used for: Code analysis, test implementation, and verification.
This ticket was mentioned in PR #12098 on WordPress/wordpress-develop by @pbearne.
11 days ago
#54
This PR adds comprehensive unit tests for the wp_ajax_save_user_color_scheme AJAX handler, covering success scenarios with different color schemes and failure cases for invalid schemes or nonces.
- Trac ticket: https://core.trac.wordpress.org/ticket/65252
- AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #12128 on WordPress/wordpress-develop by @pbearne.
7 days ago
#56
…tions
This PR adds comprehensive unit tests for the wp_ajax_destroy_sessions, wp_ajax_parse_embed and wp_ajax_query_themes AJAX handler, covering success scenarios with different color schemes and failure cases for invalid schemes or nonces.
- Trac ticket: https://core.trac.wordpress.org/ticket/65252
- AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
This ticket was mentioned in PR #12129 on WordPress/wordpress-develop by @pbearne.
7 days ago
#57
wp_ajax_generate_password/wp_ajax_nopriv_generate_passwordwp_ajax_save_wporg_usernamewp_ajax_install_themewp_ajax_delete_themewp_ajax_install_pluginwp_ajax_activate_pluginwp_ajax_search_pluginswp_ajax_search_install_pluginswp_ajax_edit_theme_plugin_file
This PR adds unit tests for various theme and plugin-related AJAX handlers in src/wp-admin/includes/ajax-actions.php. The tests cover successful operations, permission checks, and error handling for invalid nonces or missing parameters.
- Trac ticket: https://core.trac.wordpress.org/ticket/65252
- AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and verification.
This ticket was mentioned in PR #12130 on WordPress/wordpress-develop by @pbearne.
7 days ago
#58
…nd REST nonce handlers
wp_ajax_health_check_dotorg_communicationwp_ajax_health_check_background_updateswp_ajax_health_check_loopback_requestswp_ajax_health_check_site_status_resultwp_ajax_health_check_get_sizeswp_ajax_toggle_auto_updateswp_ajax_send_password_resetwp_ajax_rest_nonce
This PR adds unit tests for several AJAX handlers in src/wp-admin/includes/ajax-actions.php, including Site Health checks (dotorg communication, background updates, loopback requests, result saving, and directory sizes), plugin/theme auto-update toggling, password reset emails, and REST nonce retrieval.
- Trac ticket: https://core.trac.wordpress.org/ticket/65252
- AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and environment verification.
This ticket was mentioned in PR #12138 on WordPress/wordpress-develop by @pbearne.
7 days ago
#60
…ax_wp_fullscreen_save_post, and wp_ajax_wp_remove_post_lock`.
This PR adds unit tests for three AJAX handlers in
ajax-actions.phpto improve test coverage and ensure stability.
- Trac ticket: https://core.trac.wordpress.org/ticket/65252
- AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, refactoring to meet guidelines, and workflow management.
This PR adds unit tests for the
wp_ajax_imgedit_preview()function, which handles image editor previews via AJAX.The tests cover:
postid.postid.Trac ticket: https://core.trac.wordpress.org/ticket/65252
AI Disclosure: