mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Remove (or at least reduce) the need to reset common $_SERVER variables before assertions or between tests, by introducing a method which automatically resets them during test setup.
See #35954 git-svn-id: https://develop.svn.wordpress.org/trunk@36721 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3,10 +3,11 @@
|
||||
/**
|
||||
* Resets various `$_SERVER` variables that can get altered during tests.
|
||||
*/
|
||||
function tests_reset_SERVER() {
|
||||
function tests_reset__SERVER() {
|
||||
$_SERVER['HTTP_HOST'] = WP_TESTS_DOMAIN;
|
||||
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
|
||||
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||
$_SERVER['REQUEST_URI'] = '';
|
||||
$_SERVER['SERVER_NAME'] = WP_TESTS_DOMAIN;
|
||||
$_SERVER['SERVER_PORT'] = '80';
|
||||
$_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1';
|
||||
|
||||
Reference in New Issue
Block a user