Ticket #37207: 37207.diff
File 37207.diff, 1.6 KB (added by , 9 years ago) |
---|
-
tests/phpunit/includes/bootstrap.php
86 86 // Delete any default posts & related data 87 87 _delete_all_posts(); 88 88 89 // Store query vars to reset after each test 90 $GLOBALS['wp_bootstrapped'] = clone $GLOBALS['wp']; 91 89 92 require dirname( __FILE__ ) . '/testcase.php'; 90 93 require dirname( __FILE__ ) . '/testcase-rest-api.php'; 91 94 require dirname( __FILE__ ) . '/testcase-xmlrpc.php'; -
tests/phpunit/includes/functions.php
154 154 155 155 return $uploads; 156 156 } 157 158 /** 159 * Restore the global `$wp`'s query vars back to the state after WP was loaded. 160 */ 161 function _restore_wp_query_vars() { 162 $GLOBALS['wp']->public_query_vars = $GLOBALS['wp_bootstrapped']->public_query_vars; 163 $GLOBALS['wp']->private_query_vars = $GLOBALS['wp_bootstrapped']->private_query_vars; 164 } -
tests/phpunit/includes/testcase.php
146 146 } 147 147 $wp_query = new WP_Query(); 148 148 $wp = new WP(); 149 _restore_wp_query_vars(); 149 150 $post = null; 150 151 remove_theme_support( 'html5' ); 151 152 remove_filter( 'query', array( $this, '_create_temporary_tables' ) );