Tests: Use a more descriptive name for the sticky posts test that verifies the parameters from the main query.

Reorder the parameters of the `get_posts()` call for consistency with similar calls elsewhere.

Follow-up to [52982].

See #36907.

git-svn-id: https://develop.svn.wordpress.org/trunk@52985 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
SergeyBiryukov 2022-03-23 16:26:01 +00:00
parent fc4e1a4d5c
commit 55c399ff04
2 changed files with 4 additions and 4 deletions

View File

@ -3260,14 +3260,14 @@ class WP_Query {
if ( ! empty( $sticky_posts ) ) {
$stickies = get_posts(
array(
'cache_results' => $q['cache_results'],
'lazy_load_term_meta' => $q['lazy_load_term_meta'],
'post__in' => $sticky_posts,
'post_type' => $post_type,
'post_status' => 'publish',
'suppress_filters' => $q['suppress_filters'],
'cache_results' => $q['cache_results'],
'update_post_meta_cache' => $q['update_post_meta_cache'],
'update_post_term_cache' => $q['update_post_term_cache'],
'lazy_load_term_meta' => $q['lazy_load_term_meta'],
)
);

View File

@ -109,7 +109,7 @@ class Tests_Query_Stickies extends WP_UnitTestCase {
/**
* @ticket 36907
*/
public function test_stickies_nest_query() {
public function test_stickies_should_obey_parameters_from_the_main_query() {
$filter = new MockAction();
add_filter( 'posts_pre_query', array( $filter, 'filter' ), 10, 2 );
$this->go_to( '/' );
@ -119,10 +119,10 @@ class Tests_Query_Stickies extends WP_UnitTestCase {
$this->assertNotEmpty( $sticky_query_vars['posts_per_page'] );
$this->assertSame( $query_vars['suppress_filters'], $sticky_query_vars['suppress_filters'] );
$this->assertSame( $query_vars['cache_results'], $sticky_query_vars['cache_results'] );
$this->assertSame( $query_vars['update_post_meta_cache'], $sticky_query_vars['update_post_meta_cache'] );
$this->assertSame( $query_vars['update_post_term_cache'], $sticky_query_vars['update_post_term_cache'] );
$this->assertSame( $query_vars['lazy_load_term_meta'], $sticky_query_vars['lazy_load_term_meta'] );
$this->assertSame( $query_vars['cache_results'], $sticky_query_vars['cache_results'] );
$this->assertTrue( $sticky_query_vars['ignore_sticky_posts'] );
$this->assertTrue( $sticky_query_vars['no_found_rows'] );
}