Changeset 34855 for trunk/tests/phpunit/tests/xmlrpc/wp/editPost.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/editPost.php
r31983 r34855 114 114 $this->assertEquals( $editor_id, $out->post_author ); 115 115 } 116 116 117 117 function test_post_thumbnail() { 118 118 add_theme_support( 'post-thumbnails' ); … … 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 … … 159 149 160 150 // create another attachment 161 $attachment2 = array_merge( $attachment, array( 'post_title' => 'Post Thumbnail 2' ) ); 162 $attachment2_id = wp_insert_attachment( $attachment2, $upload['file'], $post_id ); 151 $attachment2_id = $this->factory->attachment->create_upload_object( $filename, $post_id ); 163 152 164 153 // change the post's post_thumbnail
Note: See TracChangeset
for help on using the changeset viewer.