diff --git a/tests/phpunit/includes/bootstrap.php b/tests/phpunit/includes/bootstrap.php index d85799a910..4e9a06ed26 100644 --- a/tests/phpunit/includes/bootstrap.php +++ b/tests/phpunit/includes/bootstrap.php @@ -22,6 +22,9 @@ if ( !is_readable( $config_file_path ) ) { die( "ERROR: wp-tests-config.php is missing! Please use wp-tests-config-sample.php to create a config file.\n" ); } require_once $config_file_path; +require_once dirname( __FILE__ ) . '/functions.php'; + +tests_reset_SERVER(); define( 'WP_TESTS_TABLE_PREFIX', $table_prefix ); define( 'DIR_TESTDATA', dirname( __FILE__ ) . '/../data' ); @@ -37,12 +40,6 @@ define( 'DISABLE_WP_CRON', true ); define( 'WP_MEMORY_LIMIT', -1 ); define( 'WP_MAX_MEMORY_LIMIT', -1 ); -$_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1'; -$_SERVER['HTTP_HOST'] = WP_TESTS_DOMAIN; -$_SERVER['SERVER_NAME'] = WP_TESTS_DOMAIN; -$_SERVER['REQUEST_METHOD'] = 'GET'; -$_SERVER['REMOTE_ADDR'] = '127.0.0.1'; - $PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php'; if ( "1" == getenv( 'WP_MULTISITE' ) || @@ -68,8 +65,6 @@ if ( $multisite ) { } unset( $multisite ); -require_once dirname( __FILE__ ) . '/functions.php'; - $GLOBALS['_wp_die_disabled'] = false; // Allow tests to override wp_die tests_add_filter( 'wp_die_handler', '_wp_die_handler_filter' ); diff --git a/tests/phpunit/includes/functions.php b/tests/phpunit/includes/functions.php index 1030edee82..e3f51dbef5 100644 --- a/tests/phpunit/includes/functions.php +++ b/tests/phpunit/includes/functions.php @@ -1,5 +1,20 @@