Skip to content

Commit 0211577

Browse files
committed
Add covers tags and expose underlying error message
1 parent 5af9455 commit 0211577

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tests/phpunit/tests/rest-api/rest-attachments-controller.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,6 +1361,7 @@ public function test_create_item_with_terms() {
13611361

13621362
/**
13631363
* @ticket 41692
1364+
* @covers WP_REST_Posts_Controller::handle_featured_media()
13641365
*/
13651366
public function test_create_update_post_with_featured_media() {
13661367
// Add support for thumbnails on all attachment types to avoid incorrect-usage notice.
@@ -1424,7 +1425,7 @@ public function test_create_update_post_with_featured_media() {
14241425
);
14251426
$request->set_body_params( $params );
14261427
$response = rest_get_server()->dispatch( $request );
1427-
$this->assertSame( 200, $response->get_status() );
1428+
$this->assertSame( 200, $response->get_status(), $response->is_error() ? 'Error: ' . $response->as_error()->get_error_message() : '' );
14281429
$data = $response->get_data();
14291430
$this->assertSame( $attachment_id, $data['featured_media'] );
14301431
$this->assertSame( $attachment_id, get_post_thumbnail_id( $new_attachment->ID ) );

tests/phpunit/tests/rest-api/rest-posts-controller.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3288,6 +3288,9 @@ public function test_create_post_with_unsupported_format() {
32883288
$this->assertSame( 'link', $data['format'] );
32893289
}
32903290

3291+
/**
3292+
* @covers WP_REST_Posts_Controller::handle_featured_media()
3293+
*/
32913294
public function test_create_update_post_with_featured_media() {
32923295

32933296
$file = DIR_TESTDATA . '/images/canola.jpg';

0 commit comments

Comments
 (0)