Changeset 63777
- Timestamp:
- 09/21/2026 05:46:35 PM (5 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php
r63564 r63777 2974 2974 /** 2975 2975 * @ticket 44405 2976 * @requires function imagejpeg2977 2976 */ 2978 2977 public function test_edit_image_returns_error_if_logged_out() { 2979 $attachment = self::factory()->attachment->create_upload_object( self::$test_file ); 2978 $attachment = self::factory()->attachment->create( 2979 array( 2980 'file' => 'canola.jpg', 2981 'post_mime_type' => 'image/jpeg', 2982 'post_status' => 'inherit', 2983 ) 2984 ); 2980 2985 2981 2986 $request = new WP_REST_Request( 'POST', "/wp/v2/media/{$attachment}/edit" ); … … 2987 2992 /** 2988 2993 * @ticket 44405 2989 * @requires function imagejpeg2990 2994 */ 2991 2995 public function test_edit_image_returns_error_if_cannot_upload() { … … 2994 2998 2995 2999 wp_set_current_user( $user->ID ); 2996 $attachment = self::factory()->attachment->create_upload_object( self::$test_file ); 3000 $attachment = self::factory()->attachment->create( 3001 array( 3002 'file' => 'canola.jpg', 3003 'post_mime_type' => 'image/jpeg', 3004 'post_status' => 'inherit', 3005 ) 3006 ); 2997 3007 2998 3008 $request = new WP_REST_Request( 'POST', "/wp/v2/media/{$attachment}/edit" ); … … 3004 3014 /** 3005 3015 * @ticket 44405 3006 * @requires function imagejpeg3007 3016 */ 3008 3017 public function test_edit_image_returns_error_if_cannot_edit() { 3009 3018 wp_set_current_user( self::$uploader_id ); 3010 $attachment = self::factory()->attachment->create_upload_object( self::$test_file ); 3019 $attachment = self::factory()->attachment->create( 3020 array( 3021 'file' => 'canola.jpg', 3022 'post_mime_type' => 'image/jpeg', 3023 'post_status' => 'inherit', 3024 ) 3025 ); 3011 3026 3012 3027 $request = new WP_REST_Request( 'POST', "/wp/v2/media/{$attachment}/edit" ); … … 3220 3235 */ 3221 3236 public function test_edit_image_rotate_with_unbaked_exif_orientation() { 3237 // Only the full-size image dimensions are checked, so no intermediate sizes are needed. 3238 add_filter( 'intermediate_image_sizes_advanced', '__return_empty_array' ); 3239 3222 3240 wp_set_current_user( self::$superadmin_id ); 3223 3241 $attachment = self::factory()->attachment->create_upload_object( DIR_TESTDATA . '/images/test-image-rotated-90ccw.jpg' );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)