mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 12:50:28 +00:00
Tests: Use the function get_num_queries across all unit tests.
Replace use of `$wpdb->num_queries` with a function call to `get_num_queries`. This improves readability and consistency between tests. Props SergeyBiryukov, peterwilsoncc, spacedmonkey. See #57841. git-svn-id: https://develop.svn.wordpress.org/trunk@55745 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -271,7 +271,7 @@ class Tests_WP_Customize_Manager extends WP_UnitTestCase {
|
||||
* @ticket 41039
|
||||
*/
|
||||
public function test_fresh_site_flag_clearing() {
|
||||
global $wp_customize, $wpdb;
|
||||
global $wp_customize;
|
||||
|
||||
// Make sure fresh site flag is cleared when publishing a changeset.
|
||||
update_option( 'fresh_site', '1' );
|
||||
@@ -283,9 +283,9 @@ class Tests_WP_Customize_Manager extends WP_UnitTestCase {
|
||||
wp_load_alloptions();
|
||||
|
||||
// Make sure no DB write is done when publishing and a site is already non-fresh.
|
||||
$query_count = $wpdb->num_queries;
|
||||
$query_count = get_num_queries();
|
||||
do_action( 'customize_save_after', $wp_customize );
|
||||
$this->assertSame( $query_count, $wpdb->num_queries );
|
||||
$this->assertSame( $query_count, get_num_queries() );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user