From 5349b0a08c5e80f4954385e61f669aed4faf8662 Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Mon, 27 Feb 2017 17:50:21 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/image/functions.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/phpunit/tests/image/functions.php b/tests/phpunit/tests/image/functions.php index b64d43b8ac..7ed2f0b1b2 100644 --- a/tests/phpunit/tests/image/functions.php +++ b/tests/phpunit/tests/image/functions.php @@ -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' );