Changeset 47122 for trunk/tests/phpunit/tests/xmlrpc/mw/editPost.php
- Timestamp:
- 01/29/2020 12:43:23 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/mw/editPost.php
r46586 r47122 146 146 $this->assertEquals( '', get_post_meta( $post_id, '_thumbnail_id', true ) ); 147 147 148 // create attachment148 // Create attachment. 149 149 $filename = ( DIR_TESTDATA . '/images/a2-small.jpg' ); 150 150 $attachment_id = self::factory()->attachment->create_upload_object( $filename, $post_id ); 151 151 152 // add post thumbnail to post that does not have one152 // Add post thumbnail to post that does not have one. 153 153 $post2 = array( 'wp_post_thumbnail' => $attachment_id ); 154 154 $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'author', 'author', $post2 ) ); … … 156 156 $this->assertEquals( $attachment_id, get_post_meta( $post_id, '_thumbnail_id', true ) ); 157 157 158 // edit the post without supplying a post_thumbnail and check that it didn't change158 // Edit the post without supplying a post_thumbnail and check that it didn't change. 159 159 $post3 = array( 'post_content' => 'Updated post' ); 160 160 $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'author', 'author', $post3 ) ); … … 162 162 $this->assertEquals( $attachment_id, get_post_meta( $post_id, '_thumbnail_id', true ) ); 163 163 164 // create another attachment164 // Create another attachment. 165 165 $attachment2_id = self::factory()->attachment->create_upload_object( $filename, $post_id ); 166 166 167 // change the post's post_thumbnail167 // Change the post's post_thumbnail. 168 168 $post4 = array( 'wp_post_thumbnail' => $attachment2_id ); 169 169 $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'author', 'author', $post4 ) ); … … 171 171 $this->assertEquals( $attachment2_id, get_post_meta( $post_id, '_thumbnail_id', true ) ); 172 172 173 // unset the post's post_thumbnail173 // Unset the post's post_thumbnail. 174 174 $post5 = array( 'wp_post_thumbnail' => '' ); 175 175 $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'author', 'author', $post5 ) ); … … 247 247 } 248 248 249 // Not allowed since [19914] 249 // Not allowed since [19914]. 250 250 function test_change_post_type() { 251 251 $contributor_id = $this->make_user_by_role( 'contributor' );
Note: See TracChangeset
for help on using the changeset viewer.