Changeset 39714 for branches/4.2/tests/phpunit/tests/media.php
- Timestamp:
- 01/05/2017 04:16:55 PM (8 years ago)
- Location:
- branches/4.2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.2
- Property svn:mergeinfo changed
/branches/4.6 (added) merged: 38615
- Property svn:mergeinfo changed
-
branches/4.2/tests/phpunit/tests/media.php
r33518 r39714 561 561 562 562 /** 563 * @ticket 37989 564 */ 565 public function test_media_handle_upload_expected_titles() { 566 $test_file = DIR_TESTDATA . '/images/test-image.jpg'; 567 568 // Make a copy of this file as it gets moved during the file upload 569 $tmp_name = wp_tempnam( $test_file ); 570 571 copy( $test_file, $tmp_name ); 572 573 $_FILES['upload'] = array( 574 'tmp_name' => $tmp_name, 575 'name' => 'This is a test.jpg', 576 'type' => 'image/jpeg', 577 'error' => 0, 578 'size' => filesize( $test_file ), 579 ); 580 581 $post_id = media_handle_upload( 'upload', 0, array(), array( 'action' => 'test_upload_titles', 'test_form' => false ) ); 582 583 unset( $_FILES['upload'] ); 584 585 $post = get_post( $post_id ); 586 587 // Clean up. 588 wp_delete_attachment( $post_id ); 589 590 $this->assertEquals( 'This is a test', $post->post_title ); 591 } 592 593 /** 563 594 * @ticket 33016 564 595 */
Note: See TracChangeset
for help on using the changeset viewer.