Repository navigation
Tests: Cover the_archive_title() - #15315
devmuhib009 wants to merge 1 commit into
Conversation
|
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: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified for the added archive-title display tests.
No open issues 🎉
What changed in this PR
Adds direct unit test coverage for WordPress’s the_archive_title() display wrapper, complementing existing coverage for get_the_archive_title().
Changes:
- Adds a dedicated test class with an explicit
@coversannotation. - Verifies category archive output, before/after markup, and output with an empty prefix.
- Confirms that an empty title produces no output, including no surrounding markup.
| File | Description |
|---|---|
tests/phpunit/tests/general/theArchiveTitle.php |
Adds four tests covering archive title display and empty-output behavior. |
Review effort: Balanced
huzaifaalmesbah
left a comment
There was a problem hiding this comment.
I left a few small notes inline.
AI Review: Opus 5.5
| * | ||
| * @ticket 65819 | ||
| */ | ||
| public function test_the_archive_title_without_prefix() { |
There was a problem hiding this comment.
Optional: this one exercises get_the_archive_title() more than the wrapper, which has no prefix logic of its own, and template.php already uses the same filter. Feel free to drop it.
lancewillett
left a comment
There was a problem hiding this comment.
Reviewed the changed code against the implementation and existing coverage; no blocking issue found.
Validated with the related behavioral coverage patches on current trunk: 35 tests / 43 assertions in each of single-site and multisite, randomized seed 1101. No failures, errors, warnings, or skips.
Current-head CI and Copilot review checked.
AI review · gpt-6
Cover body-opening output, post type descriptions, archive descriptions and titles, and post type archive titles. Verify relevant display filters and return behavior. Developed in: WordPress/wordpress-develop#15240, WordPress/wordpress-develop#15241, WordPress/wordpress-develop#15242, WordPress/wordpress-develop#15315, WordPress/wordpress-develop#15319 Props devmuhib, huzaifaalmesbah. See #65819. Built from https://develop.svn.wordpress.org/trunk@65171 git-svn-id: http://core.svn.wordpress.org/trunk@64320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Cover body-opening output, post type descriptions, archive descriptions and titles, and post type archive titles. Verify relevant display filters and return behavior. Developed in: WordPress/wordpress-develop#15240, WordPress/wordpress-develop#15241, WordPress/wordpress-develop#15242, WordPress/wordpress-develop#15315, WordPress/wordpress-develop#15319 Props devmuhib, huzaifaalmesbah. See #65819. git-svn-id: https://develop.svn.wordpress.org/trunk@65171 602fd350-edb4-49c9-b593-d223f7449a82
|
PR #15315 landed in https://core.trac.wordpress.org/changeset/65171 |
Trac ticket: https://core.trac.wordpress.org/ticket/65819
What
Adds unit test coverage for the
the_archive_title()template tag intests/phpunit/tests/general/theArchiveTitle.php.Why
While
get_the_archive_title()has test coverage intests/phpunit/tests/general/template.php, the display wrapperthe_archive_title()lacked direct unit test coverage and a dedicated@coverstag.How
the_archive_title()outputs the formatted archive title on an archive query.the_archive_title()produces no output when the title is empty.Testing Instructions
Run the test suite and coding standards check:
All tests pass cleanly.