Changeset 28788 for trunk/tests/phpunit/tests/post/attachments.php
- Timestamp:
- 06/20/2014 06:26:17 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/attachments.php
r26004 r28788 232 232 } 233 233 234 /** 235 * @ticket 21963 236 */ 237 function test_update_attachment_fields() { 238 $filename = ( DIR_TESTDATA . '/images/test-image.jpg' ); 239 $contents = file_get_contents($filename); 240 241 $upload = wp_upload_bits( basename( $filename ), null, $contents ); 242 $this->assertTrue( empty( $upload['error'] ) ); 243 244 $id = $this->_make_attachment( $upload ); 245 246 $attached_file = get_post_meta( $id, '_wp_attached_file', true ); 247 248 $post = get_post( $id, ARRAY_A ); 249 250 $post['post_title'] = 'title'; 251 $post['post_excerpt'] = 'caption'; 252 $post['post_content'] = 'description'; 253 254 wp_update_post( $post ); 255 256 // Make sure the update didn't remove the attached file. 257 $this->assertEquals( $attached_file, get_post_meta( $id, '_wp_attached_file', true ) ); 258 } 259 234 260 }
Note: See TracChangeset
for help on using the changeset viewer.