Make WordPress Core


Ignore:
Timestamp:
02/26/2016 02:08:47 AM (10 years ago)
Author:
johnbillion
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/functions.php

    r36715 r36721  
    44 * Resets various `$_SERVER` variables that can get altered during tests.
    55 */
    6 function tests_reset_SERVER() {
     6function tests_reset__SERVER() {
    77    $_SERVER['HTTP_HOST']       = WP_TESTS_DOMAIN;
    88    $_SERVER['REMOTE_ADDR']     = '127.0.0.1';
    99    $_SERVER['REQUEST_METHOD']  = 'GET';
     10    $_SERVER['REQUEST_URI']     = '';
    1011    $_SERVER['SERVER_NAME']     = WP_TESTS_DOMAIN;
    1112    $_SERVER['SERVER_PORT']     = '80';
Note: See TracChangeset for help on using the changeset viewer.