Changeset 26088
- Timestamp:
- 11/11/2013 05:51:29 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/ajax/MediaEdit.php
r25002 r26088 20 20 */ 21 21 protected $_ids = array(); 22 22 23 23 /** 24 24 * Set up the test fixture. … … 40 40 foreach ( scandir( $uploads['basedir'] ) as $file ) 41 41 _rmdir( $uploads['basedir'] . '/' . $file ); 42 42 43 43 parent::tearDown(); 44 44 } 45 45 46 46 /** 47 47 * Function snagged from ./tests/post/attachments.php 48 48 */ 49 function _make_attachment($upload, $parent_post_id = -1) {49 function _make_attachment($upload, $parent_post_id = 0) { 50 50 $type = ''; 51 51 if ( !empty($upload['type']) ) { … … 83 83 $upload = wp_upload_bits(basename($filename), null, $contents); 84 84 $id = $this->_make_attachment($upload); 85 85 86 86 $_REQUEST['action'] = 'image-editor'; 87 87 $_REQUEST['context'] = 'edit-attachment'; … … 90 90 $_REQUEST['do'] = 'save'; 91 91 $_REQUEST['history'] = '[{"c":{"x":5,"y":8,"w":289,"h":322}}]'; 92 92 93 93 $media_meta = wp_get_attachment_metadata($id); 94 94 $this->assertArrayHasKey('sizes', $media_meta, 'attachment should have size data'); 95 95 $this->assertArrayHasKey('medium', $media_meta['sizes'], 'attachment should have data for medium size'); 96 96 $ret = wp_save_image($id); 97 97 98 98 $media_meta = wp_get_attachment_metadata($id); 99 99 $this->assertArrayHasKey('sizes', $media_meta, 'cropped attachment should have size data');
Note: See TracChangeset
for help on using the changeset viewer.