diff --git a/tests/phpunit/tests/rest-api/rest-comments-controller.php b/tests/phpunit/tests/rest-api/rest-comments-controller.php
index 112a26c..1daa35e 100644
a
|
b
|
class WP_Test_REST_Comments_Controller extends WP_Test_REST_Controller_Testcase |
1505 | 1505 | $request->set_body( wp_json_encode( $params ) ); |
1506 | 1506 | |
1507 | 1507 | $response = $this->server->dispatch( $request ); |
| 1508 | $this->assertErrorResponse( 'rest_comment_invalid_post_id', $response, 403 ); |
| 1509 | } |
1508 | 1510 | |
| 1511 | public function test_create_comment_invalid_post_id() { |
| 1512 | wp_set_current_user( self::$admin_id ); |
| 1513 | |
| 1514 | $params = array( |
| 1515 | 'author_name' => 'Homer Jay Simpson', |
| 1516 | 'author_email' => 'chunkylover53@aol.com', |
| 1517 | 'author_url' => 'http://compuglobalhypermeganet.com', |
| 1518 | 'content' => 'Here\’s to alcohol: the cause of, and solution to, all of life\’s problems.', |
| 1519 | 'status' => 'approved', |
| 1520 | 'post' => REST_TESTS_IMPOSSIBLY_HIGH_NUMBER, |
| 1521 | ); |
| 1522 | |
| 1523 | $request = new WP_REST_Request( 'POST', '/wp/v2/comments' ); |
| 1524 | $request->add_header( 'content-type', 'application/json' ); |
| 1525 | $request->set_body( wp_json_encode( $params ) ); |
| 1526 | |
| 1527 | $response = $this->server->dispatch( $request ); |
1509 | 1528 | $this->assertErrorResponse( 'rest_comment_invalid_post_id', $response, 403 ); |
1510 | 1529 | } |
1511 | 1530 | |