Changeset 55745 for trunk/tests/phpunit/tests/term/query.php
- Timestamp:
- 05/11/2023 10:05:51 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/query.php
r55671 r55745 457 457 */ 458 458 public function test_count_query_should_be_cached() { 459 global $wpdb;460 461 459 register_taxonomy( 'wptests_tax_1', 'post' ); 462 460 … … 473 471 $this->assertEquals( 2, $count ); 474 472 475 $num_queries = $wpdb->num_queries;473 $num_queries = get_num_queries(); 476 474 477 475 $query = new WP_Term_Query( … … 484 482 $count = $query->get_terms(); 485 483 $this->assertEquals( 2, $count ); 486 $this->assertSame( $num_queries, $wpdb->num_queries);484 $this->assertSame( $num_queries, get_num_queries() ); 487 485 } 488 486 … … 804 802 */ 805 803 public function test_terms_pre_query_filter_should_bypass_database_query() { 806 global $wpdb;807 808 804 add_filter( 'terms_pre_query', array( __CLASS__, 'filter_terms_pre_query' ), 10, 2 ); 809 805 810 $num_queries = $wpdb->num_queries;806 $num_queries = get_num_queries(); 811 807 812 808 $q = new WP_Term_Query(); … … 820 816 821 817 // Make sure no queries were executed. 822 $this->assertSame( $num_queries, $wpdb->num_queries);818 $this->assertSame( $num_queries, get_num_queries() ); 823 819 824 820 // We manually inserted a non-existing term and overrode the results with it.
Note: See TracChangeset
for help on using the changeset viewer.