diff --git a/tests/phpunit/tests/link/getNextPostsLink.php b/tests/phpunit/tests/link/getNextPostsLink.php new file mode 100644 index 0000000000..8df7d10ff0 --- /dev/null +++ b/tests/phpunit/tests/link/getNextPostsLink.php @@ -0,0 +1,46 @@ +post->create_many( 3 ); + $paged = 2; + $wp_query = new WP_Query( + array( + 'post_type' => 'post', + 'posts_per_page' => 1, + 'paged' => $paged, + ) + ); + } + + /** + * Tests that the 'next_posts_link_attributes' filter is applied correctly. + * + * @ticket 55751 + */ + public function test_get_next_posts_link_should_apply_next_posts_link_attributes_filter() { + $filter = new MockAction(); + add_filter( 'next_posts_link_attributes', array( &$filter, 'filter' ) ); + + get_next_posts_link(); + + $this->assertSame( 1, $filter->get_call_count() ); + } +} diff --git a/tests/phpunit/tests/link/getPreviousPostsLink.php b/tests/phpunit/tests/link/getPreviousPostsLink.php new file mode 100644 index 0000000000..ea7220b2dc --- /dev/null +++ b/tests/phpunit/tests/link/getPreviousPostsLink.php @@ -0,0 +1,46 @@ +post->create_many( 3 ); + $paged = 2; + $wp_query = new WP_Query( + array( + 'post_type' => 'post', + 'posts_per_page' => 1, + 'paged' => $paged, + ) + ); + } + + /** + * Tests that the 'previous_posts_link_attributes' filter is applied correctly. + * + * @ticket 55751 + */ + public function test_get_previous_posts_link_should_apply_previous_posts_link_attributes_filter() { + $filter = new MockAction(); + add_filter( 'previous_posts_link_attributes', array( &$filter, 'filter' ) ); + + get_previous_posts_link(); + + $this->assertSame( 1, $filter->get_call_count() ); + } +} diff --git a/tests/phpunit/tests/link/getThePostsNavigation.php b/tests/phpunit/tests/link/getThePostsNavigation.php index c09350d054..83c262d911 100644 --- a/tests/phpunit/tests/link/getThePostsNavigation.php +++ b/tests/phpunit/tests/link/getThePostsNavigation.php @@ -1,7 +1,7 @@