Changeset 34855 for trunk/tests/phpunit/tests/xmlrpc/mw/getPost.php
- Timestamp:
- 10/06/2015 04:58:21 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/mw/getPost.php
r25002 r34855 96 96 // create attachment 97 97 $filename = ( DIR_TESTDATA.'/images/a2-small.jpg' ); 98 $contents = file_get_contents( $filename ); 99 $upload = wp_upload_bits( $filename, null, $contents ); 100 $this->assertTrue( empty( $upload['error'] ) ); 101 102 $attachment = array( 103 'post_title' => 'Post Thumbnail', 104 'post_type' => 'attachment', 105 'post_mime_type' => 'image/jpeg', 106 'guid' => $upload['url'] 107 ); 108 $attachment_id = wp_insert_attachment( $attachment, $upload['file'], $this->post_id ); 98 $attachment_id = $this->factory->attachment->create_upload_object( $filename ); 109 99 110 100 set_post_thumbnail( $this->post_id, $attachment_id );
Note: See TracChangeset
for help on using the changeset viewer.