Changeset 34855 for trunk/tests/phpunit/tests/xmlrpc/mw/editPost.php
- Timestamp:
- 10/06/2015 04:58:21 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/mw/editPost.php
r34682 r34855 127 127 // create attachment 128 128 $filename = ( DIR_TESTDATA.'/images/a2-small.jpg' ); 129 $contents = file_get_contents( $filename ); 130 $upload = wp_upload_bits( $filename, null, $contents ); 131 $this->assertTrue( empty( $upload['error'] ) ); 132 133 $attachment = array( 134 'post_title' => 'Post Thumbnail', 135 'post_type' => 'attachment', 136 'post_mime_type' => 'image/jpeg', 137 'guid' => $upload['url'] 138 ); 139 $attachment_id = wp_insert_attachment( $attachment, $upload['file'], $post_id ); 129 $attachment_id = $this->factory->attachment->create_upload_object( $filename, $post_id ); 140 130 141 131 // add post thumbnail to post that does not have one … … 152 142 153 143 // create another attachment 154 $attachment2 = array_merge( $attachment, array( 'title' => 'Post Thumbnail 2' ) ); 155 $attachment2_id = wp_insert_attachment( $attachment2, $upload['file'], $post_id ); 144 $attachment2_id = $this->factory->attachment->create_upload_object( $filename, $post_id ); 156 145 157 146 // change the post's post_thumbnail
Note: See TracChangeset
for help on using the changeset viewer.