REST API: Fix tests from r36529.
See #35329. git-svn-id: https://develop.svn.wordpress.org/trunk@36531 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0d4a6d0f6e
commit
5534474cef
@ -13,15 +13,20 @@ class Tests_REST_Server extends WP_Test_REST_TestCase {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
/** @var WP_REST_Server $wp_rest_server */
|
||||
global $wp_rest_server;
|
||||
|
||||
unset( $wp_rest_server );
|
||||
// Reset REST server to ensure only our routes are registered
|
||||
$GLOBALS['wp_rest_server'] = null;
|
||||
add_filter( 'wp_rest_server_class', array( $this, 'filter_wp_rest_server_class' ) );
|
||||
$this->server = rest_get_server();
|
||||
remove_filter( 'wp_rest_server_class', array( $this, 'filter_wp_rest_server_class' ) );
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
// Remove our temporary spy server
|
||||
$GLOBALS['wp_rest_server'] = null;
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function test_envelope() {
|
||||
$data = array(
|
||||
'amount of arbitrary data' => 'alot',
|
||||
|
Loading…
Reference in New Issue
Block a user