Changes from branches/4.0/tests/phpunit/tests/post/attachments.php at r30258 to trunk/tests/phpunit/tests/post/attachments.php at r29120
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/post/attachments.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/attachments.php
r30258 r29120 255 255 } 256 256 257 /**258 * @ticket 29646259 */260 function test_update_orphan_attachment_parent() {261 $filename = ( DIR_TESTDATA . '/images/test-image.jpg' );262 $contents = file_get_contents( $filename );263 264 $upload = wp_upload_bits( basename( $filename ), null, $contents );265 $this->assertTrue( empty( $upload['error'] ) );266 267 $attachment_id = $this->_make_attachment( $upload );268 269 // Assert that the attachment is an orphan270 $attachment = get_post( $attachment_id );271 $this->assertEquals( $attachment->post_parent, 0 );272 273 $post_id = wp_insert_post( array( 'post_content' => rand_str(), 'post_title' => rand_str() ) );274 275 // Assert that the attachment has a parent276 wp_insert_attachment( $attachment, '', $post_id );277 $attachment = get_post( $attachment_id );278 $this->assertEquals( $attachment->post_parent, $post_id );279 }280 281 257 }
Note: See TracChangeset
for help on using the changeset viewer.