Changeset 55745 for trunk/tests/phpunit/tests/comment/getPageOfComment.php
- Timestamp:
- 05/11/2023 10:05:51 AM (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/getPageOfComment.php
r53863 r55745 101 101 */ 102 102 public function test_subsequent_calls_should_hit_cache() { 103 global $wpdb;104 105 103 $p = self::factory()->post->create(); 106 104 $c = self::factory()->comment->create( array( 'comment_post_ID' => $p ) ); … … 109 107 $page_1 = get_page_of_comment( $c, array( 'per_page' => 3 ) ); 110 108 111 $num_queries = $wpdb->num_queries;109 $num_queries = get_num_queries(); 112 110 $page_2 = get_page_of_comment( $c, array( 'per_page' => 3 ) ); 113 111 114 112 $this->assertSame( $page_1, $page_2 ); 115 $this->assertSame( $num_queries, $wpdb->num_queries);113 $this->assertSame( $num_queries, get_num_queries() ); 116 114 } 117 115 … … 120 118 */ 121 119 public function test_cache_hits_should_be_sensitive_to_comment_type() { 122 global $wpdb;123 124 120 $p = self::factory()->post->create(); 125 121 $comment = self::factory()->comment->create( … … 152 148 $this->assertSame( 2, $page_trackbacks ); 153 149 154 $num_queries = $wpdb->num_queries;150 $num_queries = get_num_queries(); 155 151 $page_comments = get_page_of_comment( 156 152 $comment, … … 162 158 $this->assertSame( 1, $page_comments ); 163 159 164 $this->assertNotEquals( $num_queries, $wpdb->num_queries);160 $this->assertNotEquals( $num_queries, get_num_queries() ); 165 161 } 166 162
Note: See TracChangeset
for help on using the changeset viewer.