Changeset 34855 for trunk/tests/phpunit/tests/xmlrpc/wp/newPost.php
- Timestamp:
- 10/06/2015 04:58:21 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/wp/newPost.php
r34681 r34855 129 129 // create attachment 130 130 $filename = ( DIR_TESTDATA.'/images/a2-small.jpg' ); 131 $contents = file_get_contents( $filename ); 132 $upload = wp_upload_bits( $filename, null, $contents ); 133 $this->assertTrue( empty( $upload['error'] ) ); 134 135 $attachment = array( 136 'post_title' => 'Post Thumbnail', 137 'post_type' => 'attachment', 138 'post_mime_type' => 'image/jpeg', 139 'guid' => $upload['url'] 140 ); 141 $attachment_id = wp_insert_attachment( $attachment, $upload['file'] ); 131 $attachment_id = $this->factory->attachment->create_upload_object( $filename ); 142 132 143 133 $post = array( 'post_title' => 'Post Thumbnail Test', 'post_thumbnail' => $attachment_id );
Note: See TracChangeset
for help on using the changeset viewer.