WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/25/2016 09:59:56 PM (5 years ago)
Author:
johnbillion
Message:

Unify the initialisation of $_SERVER variables during test bootstrap. This abstracts the (re-)initialisation into a function that can be used inside of tests too, before assertions are performed.

See #35954

File:
1 edited

Legend:

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

    r36055 r36715  
    1414require_once dirname( __FILE__ ) . '/functions.php';
    1515
    16 $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1';
    17 $_SERVER['HTTP_HOST'] = WP_TESTS_DOMAIN;
    18 $_SERVER['SERVER_NAME'] = WP_TESTS_DOMAIN;
    19 $_SERVER['REQUEST_METHOD'] = 'GET';
    20 $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
     16tests_reset_SERVER();
    2117
    2218$PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php';
Note: See TracChangeset for help on using the changeset viewer.