Set `$_SERVER['REQUEST_METHOD']` for unit tests.
Props johnbillion. Fixes #32636. git-svn-id: https://develop.svn.wordpress.org/trunk@32785 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9f2ad2538e
commit
2860548f5b
|
@ -37,6 +37,7 @@ define( 'WP_MAX_MEMORY_LIMIT', -1 );
|
||||||
|
|
||||||
$_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1';
|
$_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1';
|
||||||
$_SERVER['HTTP_HOST'] = WP_TESTS_DOMAIN;
|
$_SERVER['HTTP_HOST'] = WP_TESTS_DOMAIN;
|
||||||
|
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||||
$PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php';
|
$PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php';
|
||||||
|
|
||||||
if ( "1" == getenv( 'WP_MULTISITE' ) ||
|
if ( "1" == getenv( 'WP_MULTISITE' ) ||
|
||||||
|
|
|
@ -15,6 +15,7 @@ require_once dirname( __FILE__ ) . '/functions.php';
|
||||||
|
|
||||||
$_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1';
|
$_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1';
|
||||||
$_SERVER['HTTP_HOST'] = WP_TESTS_DOMAIN;
|
$_SERVER['HTTP_HOST'] = WP_TESTS_DOMAIN;
|
||||||
|
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||||
$PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php';
|
$PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php';
|
||||||
|
|
||||||
require_once ABSPATH . '/wp-settings.php';
|
require_once ABSPATH . '/wp-settings.php';
|
||||||
|
|
|
@ -10,8 +10,6 @@ class Tests_Auth extends WP_UnitTestCase {
|
||||||
function setUp() {
|
function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->user_id = $this->factory->user->create();
|
$this->user_id = $this->factory->user->create();
|
||||||
|
|
||||||
$_SERVER['REQUEST_METHOD'] = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_auth_cookie_valid() {
|
function test_auth_cookie_valid() {
|
||||||
|
|
Loading…
Reference in New Issue