@@ -1102,12 +1102,12 @@ public function test_create_update_post_with_featured_media() {
11021102 $ response = rest_get_server ()->dispatch ( $ request );
11031103 $ data = $ response ->get_data ();
11041104
1105- $ this ->assertEquals ( 201 , $ response ->get_status () );
1105+ $ this ->assertSame ( 201 , $ response ->get_status () );
11061106
11071107 $ new_attachment = get_post ( $ data ['id ' ] );
11081108
1109- $ this ->assertEquals ( $ attachment_id , ( int ) get_post_thumbnail_id ( $ new_attachment ->ID ) );
1110- $ this ->assertEquals ( $ attachment_id , $ data ['featured_media ' ] );
1109+ $ this ->assertSame ( $ attachment_id , get_post_thumbnail_id ( $ new_attachment ->ID ) );
1110+ $ this ->assertSame ( $ attachment_id , $ data ['featured_media ' ] );
11111111
11121112 $ request = new WP_REST_Request ( 'PUT ' , '/wp/v2/media/ ' . $ new_attachment ->ID );
11131113 $ params = $ this ->set_post_data (
@@ -1117,10 +1117,10 @@ public function test_create_update_post_with_featured_media() {
11171117 );
11181118 $ request ->set_body_params ( $ params );
11191119 $ response = rest_get_server ()->dispatch ( $ request );
1120- $ this ->assertEquals ( 200 , $ response ->get_status () );
1120+ $ this ->assertSame ( 200 , $ response ->get_status () );
11211121 $ data = $ response ->get_data ();
1122- $ this ->assertEquals ( 0 , $ data ['featured_media ' ] );
1123- $ this ->assertEquals ( 0 , ( int ) get_post_thumbnail_id ( $ new_attachment ->ID ) );
1122+ $ this ->assertSame ( 0 , $ data ['featured_media ' ] );
1123+ $ this ->assertSame ( 0 , get_post_thumbnail_id ( $ new_attachment ->ID ) );
11241124
11251125 $ request = new WP_REST_Request ( 'PUT ' , '/wp/v2/media/ ' . $ new_attachment ->ID );
11261126 $ params = $ this ->set_post_data (
@@ -1130,10 +1130,10 @@ public function test_create_update_post_with_featured_media() {
11301130 );
11311131 $ request ->set_body_params ( $ params );
11321132 $ response = rest_get_server ()->dispatch ( $ request );
1133- $ this ->assertEquals ( 200 , $ response ->get_status () );
1133+ $ this ->assertSame ( 200 , $ response ->get_status () );
11341134 $ data = $ response ->get_data ();
1135- $ this ->assertEquals ( $ attachment_id , $ data ['featured_media ' ] );
1136- $ this ->assertEquals ( $ attachment_id , ( int ) get_post_thumbnail_id ( $ new_attachment ->ID ) );
1135+ $ this ->assertSame ( $ attachment_id , $ data ['featured_media ' ] );
1136+ $ this ->assertSame ( $ attachment_id , get_post_thumbnail_id ( $ new_attachment ->ID ) );
11371137 }
11381138
11391139 public function test_update_item () {
@@ -2442,7 +2442,7 @@ public function test_edit_image() {
24422442
24432443 $ this ->assertStringEndsWith ( '-edited.jpg ' , $ item ['media_details ' ]['file ' ] );
24442444 $ this ->assertArrayHasKey ( 'parent_image ' , $ item ['media_details ' ] );
2445- $ this ->assertEquals ( $ attachment , $ item ['media_details ' ]['parent_image ' ]['attachment_id ' ] );
2445+ $ this ->assertSame ( ( string ) $ attachment , $ item ['media_details ' ]['parent_image ' ]['attachment_id ' ] );
24462446 $ this ->assertStringContainsString ( 'canola ' , $ item ['media_details ' ]['parent_image ' ]['file ' ] );
24472447 }
24482448
@@ -2485,7 +2485,7 @@ public function test_batch_edit_image() {
24852485
24862486 $ this ->assertStringEndsWith ( '-edited.jpg ' , $ item ['media_details ' ]['file ' ] );
24872487 $ this ->assertArrayHasKey ( 'parent_image ' , $ item ['media_details ' ] );
2488- $ this ->assertEquals ( $ attachment , $ item ['media_details ' ]['parent_image ' ]['attachment_id ' ] );
2488+ $ this ->assertSame ( ( string ) $ attachment , $ item ['media_details ' ]['parent_image ' ]['attachment_id ' ] );
24892489 $ this ->assertStringContainsString ( 'canola ' , $ item ['media_details ' ]['parent_image ' ]['file ' ] );
24902490 }
24912491
0 commit comments