From 380f0865a9b6dc4f04cc9ed22494a3bad236119d Mon Sep 17 00:00:00 2001 From: Muhibul Haque Date: Sun, 1 Nov 2026 16:44:23 +0600 Subject: [PATCH] Tests: Cover next_post_rel_link() and prev_post_rel_link(). See #65819. Props devmuhib009. --- .../tests/link/getAdjacentPostRelLink.php | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/tests/link/getAdjacentPostRelLink.php b/tests/phpunit/tests/link/getAdjacentPostRelLink.php index 950780c7770c3..62b344deb20fd 100644 --- a/tests/phpunit/tests/link/getAdjacentPostRelLink.php +++ b/tests/phpunit/tests/link/getAdjacentPostRelLink.php @@ -1,12 +1,15 @@ expectOutputString( '' ); adjacent_posts_rel_link_wp_head(); } + + /** + * Tests next_post_rel_link() outputs relational link for next post. + * + * @ticket 65819 + * + * @covers ::next_post_rel_link + */ + public function test_next_post_rel_link() { + $this->set_permalink_structure( '' ); + $this->go_to( get_permalink( self::$post_ids[1] ) ); + + $expected = "\n"; + + $this->expectOutputString( $expected ); + next_post_rel_link(); + } + + /** + * Tests prev_post_rel_link() outputs relational link for previous post. + * + * @ticket 65819 + * + * @covers ::prev_post_rel_link + */ + public function test_prev_post_rel_link() { + $this->set_permalink_structure( '' ); + $this->go_to( get_permalink( self::$post_ids[1] ) ); + + $expected = "\n"; + + $this->expectOutputString( $expected ); + prev_post_rel_link(); + } }