Repository navigation
Tests: Add unit test coverage for the_feed_link() and post_comments_feed_link() - #14493
rejaulalomkhan wants to merge 1 commit into
Conversation
…eed_link() Adds dedicated PHPUnit test coverage for the_feed_link() and post_comments_feed_link() in tests/phpunit/tests/link/. See #65819.
|
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 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. |
There was a problem hiding this comment.
🟢 Approval recommended
Static review found no blocking issues in these test-only additions; tests were not executed during this review.
No open issues 🎉
What changed in this PR
Adds dedicated unit tests for WordPress feed-link output functions without changing production code.
Changes:
- Covers default and custom feeds with plain and pretty permalinks.
- Verifies link text, global post fallback, and output filters.
| File | Description |
|---|---|
| tests/phpunit/tests/link/theFeedLink.php | Tests feed anchor markup, URLs, feed types, and filtering. |
| tests/phpunit/tests/link/postCommentsFeedLink.php | Tests comment feed links, custom text, post fallback, and filtering. |
Review effort: Balanced
lancewillett
left a comment
There was a problem hiding this comment.
The feed-link output and filter cases look correct.
Unit-tests audit complete. The batch passed randomized single-site and multisite runs, individual PR suites, and PHPCS. Three existing image-format cases were skipped; the changed image assertions executed successfully.
Optional, non-blocking: assert the full filtered anchor in the two output-filter tests, instead of only its prefix and suffix. This would strengthen the existing checks without adding more cases.
AI review · gpt-6
Cover `the_feed_link()` and `post_comments_feed_link()` output, feed arguments, permalink formats, and filters. Developed in: #14493 Props rejaulalomkhan. See #65819. git-svn-id: https://develop.svn.wordpress.org/trunk@64573 602fd350-edb4-49c9-b593-d223f7449a82
|
PR #14493 landed in https://core.trac.wordpress.org/changeset/64573 |
Cover `the_feed_link()` and `post_comments_feed_link()` output, feed arguments, permalink formats, and filters. Developed in: WordPress/wordpress-develop#14493 Props rejaulalomkhan. See #65819. Built from https://develop.svn.wordpress.org/trunk@64573 git-svn-id: http://core.svn.wordpress.org/trunk@63723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Description
Adds dedicated unit test coverage for
the_feed_link()andpost_comments_feed_link()intests/phpunit/tests/link/theFeedLink.phpandtests/phpunit/tests/link/postCommentsFeedLink.php.The tests cover:
the_feed_link():/%year%/%monthnum%/%day%/%postname%/).atom).the_feed_linkfilter hook.post_comments_feed_link():Comments Feed) and URL for posts on plain permalinks.Subscribe via RSS).$postwhen$post_idis 0.atom).post_comments_feed_link_htmlfilter hook.This is a test-only change; no production code is modified.
Testing Instructions
npm run test:php -- --filter "Tests_Link_TheFeedLink|Tests_Link_PostCommentsFeedLink"npm run test:php -- -c tests/phpunit/multisite.xml --filter "Tests_Link_TheFeedLink|Tests_Link_PostCommentsFeedLink"npm run test:php -- --group linkTrac ticket: https://core.trac.wordpress.org/ticket/65819
Use of AI Tools
AI assistance: Yes
Tool(s): Antigravity
Model(s): Antigravity Agent
Used for: Drafting the tests and running technical verification checks (single-site, multisite, random-order, link group, PHPCS, mutation tests). I reviewed the changes, ran the tests locally, and take responsibility for them.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.