You appear to be a bot. Output may be restricted
Description
Usage
WP_Test_REST_Comments_Controller::test_create_comment_no_post_id();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/rest-api/rest-comments-controller.php
Lines:
1 to 19 of 19
public function test_create_comment_no_post_id() { wp_set_current_user( self::$admin_id ); $params = array( 'author_name' => 'Comic Book Guy', 'author_email' => 'cbg@androidsdungeon.com', 'author_url' => 'http://androidsdungeon.com', 'content' => 'Worst Comment Ever!', 'status' => 'approved', ); $request = new WP_REST_Request( 'POST', '/wp/v2/comments' ); $request->add_header( 'content-type', 'application/json' ); $request->set_body( wp_json_encode( $params ) ); $response = rest_get_server()->dispatch( $request ); $this->assertErrorResponse( 'rest_comment_invalid_post_id', $response, 403 ); }