Skip to content
This repository has been archived by the owner on Nov 28, 2019. It is now read-only.

Commit

Permalink
#41 attachment_integration - add cleanup after test for uploads folder
Browse files Browse the repository at this point in the history
  • Loading branch information
derpixler committed Jan 22, 2016
1 parent 6c56dcf commit 8dcea5a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions inc/Import/Service/WpPostImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,17 +319,19 @@ public function import_attachment( $attachment_id, Type\ImportPostInterface $imp
file_put_contents( $upload['file'], $response['body'] );

/** post_mime_type to the attachment */
$update_attachment = wp_update_post( array(
'ID' => $attachment_id,
'post_mime_type' => $filetype['type'] )
);
wp_update_post( array(
'ID' => $attachment_id,
'post_mime_type' => $filetype['type']
)
);



// Generate the metadata for the attachment, and update the database record.
$attachment_metadata = wp_generate_attachment_metadata( $attachment_id, $upload['file'] );
wp_update_attachment_metadata( $attachment_id, $attachment_metadata );



}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function test_import_post() {
* Now define the behaviour of the mock object. Each of the specified
* methods ( @see ImportPostInterface ) should return a proper value!
*/
$origin_attachment_url = 'http://inpsyde.com/wp-content/themes/i/assets/img/logo.png';
$origin_attachment_url = 'http://inpsyde.com/wp-content/themes/i/assets/img/logo.pg';

$postdata = array(
'title' => $origin_attachment_url,
Expand Down

0 comments on commit 8dcea5a

Please sign in to comment.