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:
@@ -101,6 +101,7 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase {
|
||||
$this->reset_post_types();
|
||||
$this->reset_taxonomies();
|
||||
$this->reset_post_statuses();
|
||||
$this->reset__SERVER();
|
||||
|
||||
if ( $wp_rewrite->permalink_structure ) {
|
||||
$this->set_permalink_structure( '' );
|
||||
@@ -185,6 +186,13 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset `$_SERVER` variables
|
||||
*/
|
||||
protected function reset__SERVER() {
|
||||
tests_reset__SERVER();
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the action and filter-related globals so they can be restored later.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user