Skip to content

Tests: Cover single_cat_title() and single_tag_title() - #15322

Closed
devmuhib009 wants to merge 1 commit into
WordPress:trunkfrom
devmuhib009:tests/65819-cover-single-cat-and-tag-title
Closed

devmuhib009 wants to merge 1 commit into
WordPress:trunkfrom
devmuhib009:tests/65819-cover-single-cat-and-tag-title

Conversation

@devmuhib009

Copy link
Copy Markdown
Member

Trac ticket: https://core.trac.wordpress.org/ticket/65819

This PR extends Tests_General_SingleTermTitle to cover single_cat_title() and single_tag_title() for displaying and returning term archive titles.

@github-actions

github-actions Bot commented Nov 1, 2026

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.

Core Committers: Use this line as a base for the props when committing in SVN:

Props devmuhib.

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the changes extending category and tag title test coverage.

No open issues 🎉

What changed in this PR

This PR extends WordPress’s term archive title tests to cover single_cat_title() and single_tag_title(), supporting Trac ticket #65819.

Changes:

  • Adds tests for returning and displaying category and tag titles with prefixes.
  • Updates the test class documentation and coverage annotations to include both functions.
File Description
tests/​phpunit/​tests/​general/​singleTermTitle.php Adds category and tag title tests and updates coverage annotations.

Review effort: Balanced

@huzaifaalmesbah huzaifaalmesbah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a few small notes inline.

AI Review: Opus 5.5

*
* @ticket 65819
*
* @covers ::single_cat_title

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: the class docblock already has these @covers tags, and the other tests here don't repeat them. Feel free to drop this one and the one at line 277.

@lancewillett lancewillett left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the two added wrapper-only methods. test_returns_title_for_term_archives(), test_displays_title_by_default(), and test_displays_prefix() already protect the title, display, and prefix behavior in this class. single_cat_title() and single_tag_title() only forward the same arguments to single_term_title(). These additions repeat that behavior without a distinct transformation or branch. No replacement tests are requested.

AI review · gpt-6

@lancewillett

Copy link
Copy Markdown
Member

Thanks for extending the title coverage. Closing this PR because the existing suite already checks term titles, display, prefixes, and filters at the implementation that owns that behavior. These additions exercise only the category/tag wrappers forwarding to it. That limited wiring coverage does not justify two more fixture-backed tests; no replacement tests are requested.

AI review · gpt-6

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.

4 participants