- Timestamp:
- 05/11/2023 10:05:51 AM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/wpUpdateCommentCountNow.php
r54704 r55745 15 15 16 16 public function test_regular_post_updates_comment_count() { 17 global $wpdb;18 19 17 $post_id = self::factory()->post->create(); 20 18 … … 22 20 $this->assertSame( '1', get_comments_number( $post_id ) ); 23 21 24 $num_queries = $wpdb->num_queries;22 $num_queries = get_num_queries(); 25 23 $this->assertTrue( wp_update_comment_count_now( $post_id ) ); 26 $this->assertSame( $num_queries + 2, $wpdb->num_queries);24 $this->assertSame( $num_queries + 2, get_num_queries() ); 27 25 28 26 $this->assertSame( '1', get_comments_number( $post_id ) ); … … 39 37 $this->assertSame( '100', get_comments_number( $post_id ) ); 40 38 41 $num_queries = $wpdb->num_queries;39 $num_queries = get_num_queries(); 42 40 $this->assertTrue( wp_update_comment_count_now( $post_id ) ); 43 41 // Only one query is made instead of two. 44 $this->assertSame( $num_queries + 1, $wpdb->num_queries);42 $this->assertSame( $num_queries + 1, get_num_queries() ); 45 43 46 44 $this->assertSame( '100', get_comments_number( $post_id ) );
Note: See TracChangeset
for help on using the changeset viewer.