Changeset 55859 for trunk/tests/phpunit/tests/ajax/wpAjaxImageEditor.php
- Timestamp:
- 05/25/2023 03:15:45 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/ajax/wpAjaxImageEditor.php
r54722 r55859 63 63 64 64 /** 65 * @ticket 26381 66 * @requires function imagejpeg 67 * 68 * @covers ::wp_save_image 69 */ 70 public function testCropImageIntoLargerOne() { 71 require_once ABSPATH . 'wp-admin/includes/image-edit.php'; 72 73 $filename = DIR_TESTDATA . '/images/canola.jpg'; 74 $contents = file_get_contents( $filename ); 75 76 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 77 $id = $this->_make_attachment( $upload ); 78 79 $_REQUEST['action'] = 'image-editor'; 80 $_REQUEST['postid'] = $id; 81 $_REQUEST['do'] = 'scale'; 82 $_REQUEST['fwidth'] = 700; 83 $_REQUEST['fheight'] = 500; 84 85 $ret = wp_save_image( $id ); 86 87 $this->assertObjectHasAttribute( 'error', $ret ); 88 $this->assertEquals( 'Images cannot be scaled to a size larger than the original.', $ret->error ); 89 } 90 91 /** 65 92 * @ticket 32171 66 93 * @requires function imagejpeg
Note: See TracChangeset
for help on using the changeset viewer.