Opened 6 weeks ago
Last modified 6 weeks ago
#66019 new defect (bug)
missing tests for src/wp-admin/includes/bookmark.php functions
| Reported by: | pbearne | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.2 |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: | tests |
Description
Change History (3)
This ticket was mentioned in PR #13362 on WordPress/wordpress-develop by @khokansardar.
6 weeks ago
#1
- Keywords has-patch has-unit-tests added
This ticket was mentioned in PR #13367 on WordPress/wordpress-develop by @pbearne.
6 weeks ago
#2
Missing tests for bookmark.php
Trac ticket: https://core.trac.wordpress.org/ticket/66019
AI Disclosure:
- AI assistance: Yes
- Tool(s): Junie (JetBrains)
- Model(s): gemini-3-flash-preview
- Used for: Code analysis, test implementation, and workflow management.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
None of the ten functions in
src/wp-admin/includes/bookmark.phphad direct test coverage;wp_insert_link()andwp_delete_link()appeared only as fixtures for theget_bookmark()tests.This adds a test file per function under
tests/phpunit/tests/admin/includes/bookmark/, mirroring the source path and the structure used forwp-admin/includes/misc.phpin [62369]. The cases pin the documented contracts: the empty-URL and name-fallback returns inwp_insert_link(), its$wp_errorbranch, themanage_linkscheck and$_POSTescaping inedit_link(), category replacement and integer casting inwp_set_link_cats(), the partial-merge behaviour ofwp_update_link(), and the branches ofwp_link_manager_disabled_message().No production code is changed.
Trac ticket: https://core.trac.wordpress.org/ticket/66019
## Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: writing the test cases and checking that each one fails when the function under test is broken. All changes were reviewed and validated by me.