| 522 | |
| 523 | /** |
| 524 | * @ticket 22768 |
| 525 | */ |
| 526 | public function test_import_iptc_caption_sets_post_excerpt() { |
| 527 | $iptc_path = DIR_TESTDATA . '/images/test-image-iptc.jpg'; |
| 528 | |
| 529 | // Make a copy of this file as it gets moved during the file upload |
| 530 | $tmp = wp_tempnam(); |
| 531 | |
| 532 | copy( $iptc_path, $tmp ); |
| 533 | |
| 534 | $_FILES['upload'] = array( |
| 535 | 'tmp_name' => $tmp, |
| 536 | 'name' => 'test-image-iptc.jpg', |
| 537 | 'type' => 'image/jpeg', |
| 538 | 'error' => 0, |
| 539 | 'size' => filesize( $tmp ) |
| 540 | ); |
| 541 | |
| 542 | $_POST['action'] = 'test_iptc_upload'; |
| 543 | |
| 544 | $id = media_handle_upload( 'upload', null, array(), array( 'action' => 'test_iptc_upload' ) ); |
| 545 | |
| 546 | $post = get_post( $id ); |
| 547 | |
| 548 | $this->assertEquals('This is a comment. / Это комментарий. / Βλέπετε ένα σχόλιο.', $post->post_excerpt); |
| 549 | } |
| 550 | |