Ticket #37207: 37207.2.diff
File 37207.2.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
161 161 162 162 return $uploads; 163 163 } 164 165 /** 166 * Restore the global `$wp`'s query vars back to the state after WP was loaded. 167 */ 168 function _restore_wp_query_vars() { 169 $GLOBALS['wp']->public_query_vars = $GLOBALS['wp_bootstrapped']->public_query_vars; 170 $GLOBALS['wp']->private_query_vars = $GLOBALS['wp_bootstrapped']->private_query_vars; 171 } -
tests/phpunit/includes/testcase.php
151 151 } 152 152 $wp_query = new WP_Query(); 153 153 $wp = new WP(); 154 if ( ! defined( 'WP_RUN_CORE_TESTS' ) || ! WP_RUN_CORE_TESTS ) { 155 _restore_wp_query_vars(); 156 } 154 157 $post = null; 155 158 remove_theme_support( 'html5' ); 156 159 remove_filter( 'query', array( $this, '_create_temporary_tables' ) );