forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnextPosts.php
More file actions
41 lines (37 loc) · 828 Bytes
/
nextPosts.php
File metadata and controls
41 lines (37 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* Tests the `next_posts()` function.
*
* @since 6.4.0
*
* @group link
*
* @covers ::next_posts
*/
class Tests_Link_NextPosts extends WP_UnitTestCase {
/**
* Creates posts before any tests run.
*
* @param WP_UnitTest_Factory $factory
*/
public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
global $wp_query, $paged;
$factory->post->create_many( 3 );
$paged = 2;
$wp_query = new WP_Query(
array(
'post_type' => 'post',
'posts_per_page' => 1,
'paged' => $paged,
)
);
}
/**
* The absence of a deprecation notice on PHP 8.1+ also shows that the issue is resolved.
*
* @ticket 59154
*/
public function test_should_return_empty_string_when_no_next_posts_page_link() {
$this->assertSame( '', next_posts( 1, false ) );
}
}