Changeset 60068
- Timestamp:
- 03/22/2025 04:06:25 PM (5 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php
r59120 r60068 1103 1103 $data = $response->get_data(); 1104 1104 1105 $this->assert Equals( 201, $response->get_status() );1105 $this->assertSame( 201, $response->get_status() ); 1106 1106 1107 1107 $new_attachment = get_post( $data['id'] ); 1108 1108 1109 $this->assert Equals( $attachment_id, (int)get_post_thumbnail_id( $new_attachment->ID ) );1110 $this->assert Equals( $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'] ); 1111 1111 1112 1112 $request = new WP_REST_Request( 'PUT', '/wp/v2/media/' . $new_attachment->ID ); … … 1118 1118 $request->set_body_params( $params ); 1119 1119 $response = rest_get_server()->dispatch( $request ); 1120 $this->assert Equals( 200, $response->get_status() );1120 $this->assertSame( 200, $response->get_status() ); 1121 1121 $data = $response->get_data(); 1122 $this->assert Equals( 0, $data['featured_media'] );1123 $this->assert Equals( 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 ) ); 1124 1124 1125 1125 $request = new WP_REST_Request( 'PUT', '/wp/v2/media/' . $new_attachment->ID ); … … 1131 1131 $request->set_body_params( $params ); 1132 1132 $response = rest_get_server()->dispatch( $request ); 1133 $this->assert Equals( 200, $response->get_status() );1133 $this->assertSame( 200, $response->get_status() ); 1134 1134 $data = $response->get_data(); 1135 $this->assert Equals( $attachment_id, $data['featured_media'] );1136 $this->assert Equals( $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 ) ); 1137 1137 } 1138 1138 … … 2443 2443 $this->assertStringEndsWith( '-edited.jpg', $item['media_details']['file'] ); 2444 2444 $this->assertArrayHasKey( 'parent_image', $item['media_details'] ); 2445 $this->assert Equals($attachment, $item['media_details']['parent_image']['attachment_id'] );2445 $this->assertSame( (string) $attachment, $item['media_details']['parent_image']['attachment_id'] ); 2446 2446 $this->assertStringContainsString( 'canola', $item['media_details']['parent_image']['file'] ); 2447 2447 } … … 2486 2486 $this->assertStringEndsWith( '-edited.jpg', $item['media_details']['file'] ); 2487 2487 $this->assertArrayHasKey( 'parent_image', $item['media_details'] ); 2488 $this->assert Equals($attachment, $item['media_details']['parent_image']['attachment_id'] );2488 $this->assertSame( (string) $attachment, $item['media_details']['parent_image']['attachment_id'] ); 2489 2489 $this->assertStringContainsString( 'canola', $item['media_details']['parent_image']['file'] ); 2490 2490 }
Note: See TracChangeset
for help on using the changeset viewer.