Make WordPress Core

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

None of the ten functions in src/wp-admin/includes/bookmark.php had direct test coverage; wp_insert_link() and wp_delete_link() appeared only as fixtures for the get_bookmark() tests.

This adds a test file per function under tests/phpunit/tests/admin/includes/bookmark/, mirroring the source path and the structure used for wp-admin/includes/misc.php in [62369]. The cases pin the documented contracts: the empty-URL and name-fallback returns in wp_insert_link(), its $wp_error branch, the manage_links check and $_POST escaping in edit_link(), category replacement and integer casting in wp_set_link_cats(), the partial-merge behaviour of wp_update_link(), and the branches of wp_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.

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.

#3 @pbearne
6 weeks ago

  • Milestone Awaiting Review → 7.2

Let's use @khokansardar patch

Note: See TracTickets for help on using tickets.