Changeset 36715
- Timestamp:
- 02/25/2016 09:59:56 PM (9 years ago)
- Location:
- trunk/tests/phpunit/includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/bootstrap.php
r36563 r36715 23 23 } 24 24 require_once $config_file_path; 25 require_once dirname( __FILE__ ) . '/functions.php'; 26 27 tests_reset_SERVER(); 25 28 26 29 define( 'WP_TESTS_TABLE_PREFIX', $table_prefix ); … … 37 40 define( 'WP_MEMORY_LIMIT', -1 ); 38 41 define( 'WP_MAX_MEMORY_LIMIT', -1 ); 39 40 $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1';41 $_SERVER['HTTP_HOST'] = WP_TESTS_DOMAIN;42 $_SERVER['SERVER_NAME'] = WP_TESTS_DOMAIN;43 $_SERVER['REQUEST_METHOD'] = 'GET';44 $_SERVER['REMOTE_ADDR'] = '127.0.0.1';45 42 46 43 $PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php'; … … 68 65 } 69 66 unset( $multisite ); 70 71 require_once dirname( __FILE__ ) . '/functions.php';72 67 73 68 $GLOBALS['_wp_die_disabled'] = false; -
trunk/tests/phpunit/includes/functions.php
r36565 r36715 1 1 <?php 2 3 /** 4 * Resets various `$_SERVER` variables that can get altered during tests. 5 */ 6 function tests_reset_SERVER() { 7 $_SERVER['HTTP_HOST'] = WP_TESTS_DOMAIN; 8 $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; 9 $_SERVER['REQUEST_METHOD'] = 'GET'; 10 $_SERVER['SERVER_NAME'] = WP_TESTS_DOMAIN; 11 $_SERVER['SERVER_PORT'] = '80'; 12 $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1'; 13 14 unset( $_SERVER['HTTP_REFERER'] ); 15 unset( $_SERVER['HTTPS'] ); 16 } 2 17 3 18 // For adding hooks before loading WP -
trunk/tests/phpunit/includes/install.php
r36055 r36715 14 14 require_once dirname( __FILE__ ) . '/functions.php'; 15 15 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'; 16 tests_reset_SERVER(); 21 17 22 18 $PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php';
Note: See TracChangeset
for help on using the changeset viewer.