Media: Skip PDF preview tests when image editor doens't support.

Following [40130] tests fail on environments that don't support PDF
previews because the expected meta data doesn't get written.

See #39875.

git-svn-id: https://develop.svn.wordpress.org/trunk@40131 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Joe McGill 2017-02-27 17:50:21 +00:00
parent 9848a4a466
commit 5349b0a08c
1 changed files with 4 additions and 0 deletions

View File

@ -468,6 +468,10 @@ class Tests_Image_Functions extends WP_UnitTestCase {
* @ticket 39875
*/
public function test_pdf_preview_doesnt_overwrite_existing_jpeg() {
if ( ! wp_image_editor_supports( array( 'mime_type' => 'application/pdf' ) ) ) {
$this->markTestSkipped( 'Rendering PDFs is not supported on this system.' );
}
// Dummy JPEGs.
$jpg1_path = '/tmp/test.jpg'; // Straight.
file_put_contents( $jpg1_path, 'asdf' );