Skip to content

Commit

Permalink
Minor test fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterwilsoncc committed Feb 3, 2025
1 parent fe595f2 commit be26a94
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/phpunit/tests/user/countUserPosts.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function test_count_user_posts_should_ignore_non_existent_post_types() {
}

/**
* User count should work for users that don't exist but have posts assigned.
* Post count should work for users that don't exist but have posts assigned.
*
* @ticket 39242
*/
Expand Down Expand Up @@ -146,14 +146,14 @@ public function test_count_user_posts_for_user_created_after_being_assigned_post
* @ticket 39242
*/
public function test_cache_should_be_hit_regardless_of_post_type_order() {
// Prime Cache
// Prime Cache.
count_user_posts( self::$user_id, array( 'wptests_pt', 'post' ) );

$query_num_start = get_num_queries();
count_user_posts( self::$user_id, array( 'post', 'wptests_pt' ) );
$total_queries = get_num_queries() - $query_num_start;

$this->assertSame( 0, $total_queries );
$this->assertSame( 0, $total_queries, 'Cache should be hit regardless of post type order.' );
}

/**
Expand All @@ -162,13 +162,13 @@ public function test_cache_should_be_hit_regardless_of_post_type_order() {
* @ticket 39242
*/
public function test_cache_should_be_hit_for_string_and_array_equivalent_queries() {
// Prime Cache
// Prime Cache.
count_user_posts( self::$user_id, 'post' );

$query_num_start = get_num_queries();
count_user_posts( self::$user_id, array( 'post' ) );
$total_queries = get_num_queries() - $query_num_start;

$this->assertSame( 0, $total_queries );
$this->assertSame( 0, $total_queries, 'Cache should be hit for string and array equivalent post types.' );
}
}

0 comments on commit be26a94

Please sign in to comment.