Skip to content

Tests: Add unit tests for wp_ajax_find_posts()#11909

Open
pbearne wants to merge 1 commit into
WordPress:trunkfrom
pbearne:65252-ajax-actions-find_posts
Open

Tests: Add unit tests for wp_ajax_find_posts()#11909
pbearne wants to merge 1 commit into
WordPress:trunkfrom
pbearne:65252-ajax-actions-find_posts

Conversation

@pbearne
Copy link
Copy Markdown

@pbearne pbearne commented May 20, 2026

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 ps POST parameter.
  • Proper handling of invalid nonces (find-posts nonce).
  • 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.

Co-authored-by: Junie <junie@jetbrains.com>
@github-actions
Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @pbearne@git.wordpress.org.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant