Inheritance: extends WP_UnitTestCase
 public function tearDown()
 {
     // Remove our temporary spy server
     $GLOBALS['wp_rest_server'] = null;
     unset($_REQUEST['_wpnonce']);
     parent::tearDown();
 }
 public function tearDown()
 {
     parent::tearDown();
     /** @var WP_REST_Server $wp_rest_server */
     global $wp_rest_server;
     $wp_rest_server = null;
 }
 public function tearDown()
 {
     parent::tearDown();
     remove_filter('rest_url', array($this, 'test_rest_url_for_leading_slash'), 10, 2);
     /** @var WP_REST_Server $wp_rest_server */
     global $wp_rest_server;
     $wp_rest_server = null;
 }
 public function setUp()
 {
     parent::setUp();
     /** @var WP_REST_Server $wp_rest_server */
     global $wp_rest_server;
     $this->server = $wp_rest_server = new Spy_REST_Server();
     do_action('rest_api_init', $this->server);
 }
 /**
  * Set up.
  */
 function setUp()
 {
     parent::setUp();
     $this->plugin = get_plugin_instance();
     $this->plugin->customize_snapshot_manager->post_type->register();
     $snapshot_data = array(array('status' => 'draft', 'date_gmt' => '2010-01-01 00:00:00'), array('status' => 'pending', 'date_gmt' => '2010-01-01 00:00:00'), array('status' => 'publish', 'date_gmt' => '2010-01-01 00:00:00'), array('status' => 'future', 'date_gmt' => gmdate('Y-m-d H:i:s', time() + 24 * 3600)));
     foreach ($snapshot_data as $i => $snapshot_params) {
         $user_id = $this->factory()->user->create(array('role' => 'administrator'));
         $post_id = $this->plugin->customize_snapshot_manager->post_type->save(array_merge($snapshot_params, array('uuid' => Customize_Snapshot_Manager::generate_uuid(), 'author' => $user_id, 'data' => array('blogname' => array('value' => "Snapshot {$i}")))));
         $this->snapshot_by_status[$snapshot_params['status']] = $post_id;
     }
     global $wp_rest_server;
     $wp_rest_server = null;
     $this->server = rest_get_server();
 }
 public function setUp()
 {
     parent::setUp();
     register_meta('post', 'test_single', array('show_in_rest' => true, 'single' => true, 'type' => 'string'));
     register_meta('post', 'test_multi', array('show_in_rest' => true, 'single' => false, 'type' => 'string'));
     register_meta('post', 'test_bad_auth', array('show_in_rest' => true, 'single' => true, 'auth_callback' => '__return_false', 'type' => 'string'));
     register_meta('post', 'test_bad_auth_multi', array('show_in_rest' => true, 'single' => false, 'auth_callback' => '__return_false', 'type' => 'string'));
     register_meta('post', 'test_no_rest', array());
     register_meta('post', 'test_rest_disabled', array('show_in_rest' => false, 'type' => 'string'));
     register_meta('post', 'test_custom_schema', array('single' => true, 'type' => 'integer', 'show_in_rest' => array('schema' => array('type' => 'number'))));
     register_meta('post', 'test_custom_schema_multi', array('single' => false, 'type' => 'integer', 'show_in_rest' => array('schema' => array('type' => 'number'))));
     register_meta('post', 'test_invalid_type', array('single' => true, 'type' => 'lalala', 'show_in_rest' => true));
     register_meta('post', 'test_no_type', array('single' => true, 'type' => null, 'show_in_rest' => true));
     /** @var WP_REST_Server $wp_rest_server */
     global $wp_rest_server;
     $this->server = $wp_rest_server = new Spy_REST_Server();
     do_action('rest_api_init');
 }
 public function tearDown()
 {
     // Remove our temporary spy server
     $GLOBALS['wp_rest_server'] = null;
     parent::tearDown();
 }
 public function setUp()
 {
     parent::setUp();
     $this->request = new WP_REST_Request('GET', '/wp/v2/testroute', array('args' => array('someinteger' => array('type' => 'integer'), 'someboolean' => array('type' => 'boolean'), 'somestring' => array('type' => 'string'), 'someenum' => array('type' => 'string', 'enum' => array('a')), 'somedate' => array('type' => 'string', 'format' => 'date-time'), 'someemail' => array('type' => 'string', 'format' => 'email'))));
 }