public function test_handle_request_get_one__cannot_access() { $e = $this->new_model_obj_with_dependencies('Event', array('status' => 'draft')); $req = new \WP_REST_Request('GET', \EED_Core_Rest_Api::ee_api_namespace . '4.8.29/events/' . $e->ID()); $req->set_url_params(array('id' => $e->ID())); $response = Read::handle_request_get_one($req); $this->assertInstanceOf('WP_REST_Response', $response); $this->assertEquals(403, $response->get_status()); }