Changeset 55745 for trunk/tests/phpunit/tests/term/termExists.php
- Timestamp:
- 05/11/2023 10:05:51 AM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/termExists.php
r52921 r55745 321 321 */ 322 322 public function test_term_exists_caching() { 323 global $wpdb;324 323 register_taxonomy( 'wptests_tax', 'post' ); 325 324 … … 332 331 ); 333 332 $this->assertEquals( $t, term_exists( $slug ) ); 334 $num_queries = $wpdb->num_queries;333 $num_queries = get_num_queries(); 335 334 $this->assertEquals( $t, term_exists( $slug ) ); 336 $this->assertSame( $num_queries, $wpdb->num_queries);335 $this->assertSame( $num_queries, get_num_queries() ); 337 336 338 337 $this->assertTrue( wp_delete_term( $t, 'wptests_tax' ) ); 339 $num_queries = $wpdb->num_queries;338 $num_queries = get_num_queries(); 340 339 $this->assertNull( term_exists( $slug ) ); 341 $this->assertSame( $num_queries + 2, $wpdb->num_queries);340 $this->assertSame( $num_queries + 2, get_num_queries() ); 342 341 343 342 // Clean up. … … 350 349 */ 351 350 public function test_term_exists_caching_suspend_cache_invalidation() { 352 global $wpdb;353 351 register_taxonomy( 'wptests_tax', 'post' ); 354 352 … … 363 361 364 362 $this->assertEquals( $t, term_exists( $slug ) ); 365 $num_queries = $wpdb->num_queries;363 $num_queries = get_num_queries(); 366 364 $this->assertEquals( $t, term_exists( $slug ) ); 367 $this->assertSame( $num_queries + 1, $wpdb->num_queries);365 $this->assertSame( $num_queries + 1, get_num_queries() ); 368 366 wp_suspend_cache_invalidation( false ); 369 367
Note: See TracChangeset
for help on using the changeset viewer.