Make WordPress Core


Ignore:
Timestamp:
04/20/2015 11:08:17 AM (10 years ago)
Author:
pento
Message:

Merge the query sanity checks from #21212 to the 3.9 branch.

Props pento, nacin, mdawaffe, DrewAPicture.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.9/tests/phpunit/includes/utils.php

    r26187 r32182  
    388388    remove_filter( 'get_the_terms', array( 'Featured_Content', 'hide_the_featured_term' ), 10, 3 );
    389389}
     390
     391/**
     392 * Special class for exposing protected wpdb methods we need to access
     393 */
     394class wpdb_exposed_methods_for_testing extends wpdb {
     395    public function __construct() {
     396        global $wpdb;
     397        $this->dbh = $wpdb->dbh;
     398        $this->use_mysqli = $wpdb->use_mysqli;
     399        $this->ready = true;
     400        $this->field_types = $wpdb->field_types;
     401        $this->charset = $wpdb->charset;
     402    }
     403
     404    public function __call( $name, $arguments ) {
     405        return call_user_func_array( array( $this, $name ), $arguments );
     406    }
     407}
Note: See TracChangeset for help on using the changeset viewer.