diff --git a/tests/phpunit/includes/utils.php b/tests/phpunit/includes/utils.php index d6c79e9e6b..3d91f0663d 100644 --- a/tests/phpunit/includes/utils.php +++ b/tests/phpunit/includes/utils.php @@ -353,4 +353,22 @@ function _cleanup_query_vars() { function _clean_term_filters() { remove_filter( 'get_terms', array( 'Featured_Content', 'hide_featured_term' ), 10, 2 ); remove_filter( 'get_the_terms', array( 'Featured_Content', 'hide_the_featured_term' ), 10, 3 ); -} \ No newline at end of file +} + +/** + * Special class for exposing protected wpdb methods we need to access + */ +class wpdb_exposed_methods_for_testing extends wpdb { + public function __construct() { + global $wpdb; + $this->dbh = $wpdb->dbh; + $this->use_mysqli = $wpdb->use_mysqli; + $this->ready = true; + $this->field_types = $wpdb->field_types; + $this->charset = $wpdb->charset; + } + + public function __call( $name, $arguments ) { + return call_user_func_array( array( $this, $name ), $arguments ); + } +} diff --git a/tests/phpunit/tests/db.php b/tests/phpunit/tests/db.php index 8df0cd9b78..bd47b85e25 100644 --- a/tests/phpunit/tests/db.php +++ b/tests/phpunit/tests/db.php @@ -923,20 +923,3 @@ class Tests_DB extends WP_UnitTestCase { } } -/** - * Special class for exposing protected wpdb methods we need to access - */ -class wpdb_exposed_methods_for_testing extends wpdb { - public function __construct() { - global $wpdb; - $this->dbh = $wpdb->dbh; - $this->use_mysqli = $wpdb->use_mysqli; - $this->ready = true; - $this->field_types = $wpdb->field_types; - $this->charset = $wpdb->charset; - } - - public function __call( $name, $arguments ) { - return call_user_func_array( array( $this, $name ), $arguments ); - } -}