Make WordPress Core


Ignore:
Timestamp:
02/16/2016 01:50:06 AM (9 years ago)
Author:
rmccue
Message:

REST API: Fix tests from r36529.

See #35329.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-server.php

    r36529 r36531  
    1414        parent::setUp();
    1515
    16         /** @var WP_REST_Server $wp_rest_server */
    17         global $wp_rest_server;
    18 
    19         unset( $wp_rest_server );
     16        // Reset REST server to ensure only our routes are registered
     17        $GLOBALS['wp_rest_server'] = null;
    2018        add_filter( 'wp_rest_server_class', array( $this, 'filter_wp_rest_server_class' ) );
    2119        $this->server = rest_get_server();
    2220        remove_filter( 'wp_rest_server_class', array( $this, 'filter_wp_rest_server_class' ) );
     21    }
     22
     23    public function tearDown() {
     24        // Remove our temporary spy server
     25        $GLOBALS['wp_rest_server'] = null;
     26
     27        parent::tearDown();
    2328    }
    2429
Note: See TracChangeset for help on using the changeset viewer.