Repository navigation
Tests: Cover next_post_rel_link() and prev_post_rel_link() - #15323
devmuhib009 wants to merge 1 commit into
Conversation
…9. Props devmuhib009.
|
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 reported for the added next- and previous-post relational-link tests.
No open issues 🎉
What changed in this PR
Extends WordPress’s adjacent-post relational-link tests to cover output from next_post_rel_link() and prev_post_rel_link(), supporting Trac ticket #65819.
Changes:
- Adds tests asserting the exact next and previous relational links from the middle post.
- Updates the class documentation and coverage annotations to include both functions.
| File | Description |
|---|---|
tests/phpunit/tests/link/getAdjacentPostRelLink.php |
Adds output assertions for both directional link functions and updates coverage annotations. |
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
| $expected = "<link rel='next' title='Third Post' href='" . home_url( '?p=' . self::$post_ids[2] ) . "' />\n"; | ||
|
|
||
| $this->expectOutputString( $expected ); | ||
| next_post_rel_link(); |
There was a problem hiding this comment.
This one looks like a small coverage gap: both tests use the defaults, so they still pass if $title, $in_same_term or $excluded_terms stop being forwarded. Could you add a case with a custom title, like next_post_rel_link( 'Go to %title' ), and the same for prev_post_rel_link()?
| * | ||
| * @ticket 65819 | ||
| * | ||
| * @covers ::next_post_rel_link |
There was a problem hiding this comment.
Optional: the class docblock already has these @covers tags. Feel free to drop this one and the one at line 157.
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
Verify that `next_post_rel_link()` and `prev_post_rel_link()` output the corresponding adjacent-post relation links. Developed in: #15323 Props devmuhib, huzaifaalmesbah. See #65819. git-svn-id: https://develop.svn.wordpress.org/trunk@65173 602fd350-edb4-49c9-b593-d223f7449a82
Verify that `next_post_rel_link()` and `prev_post_rel_link()` output the corresponding adjacent-post relation links. Developed in: WordPress/wordpress-develop#15323 Props devmuhib, huzaifaalmesbah. See #65819. Built from https://develop.svn.wordpress.org/trunk@65173 git-svn-id: http://core.svn.wordpress.org/trunk@64322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
|
PR #15323 landed in https://core.trac.wordpress.org/changeset/65173 |
Trac ticket: https://core.trac.wordpress.org/ticket/65819
This PR extends
Tests_Link_GetAdjacentPostRelLinkto covernext_post_rel_link()andprev_post_rel_link()for outputting relational links to adjacent posts.