diff --git a/tests/phpunit/tests/image/functions.php b/tests/phpunit/tests/image/functions.php index cbacec809e..4a7713d52b 100644 --- a/tests/phpunit/tests/image/functions.php +++ b/tests/phpunit/tests/image/functions.php @@ -423,7 +423,10 @@ class Tests_Image_Functions extends WP_UnitTestCase { $test_file = '/tmp/wordpress-gsoc-flyer.pdf'; copy( $orig_file, $test_file ); - $this->assertNotWPError( wp_get_image_editor( $test_file ) ); + $editor = wp_get_image_editor( $test_file ); + if ( is_wp_error( $editor ) ) { + $this->markTestSkipped( $editor->get_error_message() ); + } $attachment_id = $this->factory->attachment->create_object( $test_file, @@ -490,7 +493,10 @@ class Tests_Image_Functions extends WP_UnitTestCase { $test_file = get_temp_dir() . 'wordpress-gsoc-flyer.pdf'; copy( $orig_file, $test_file ); - $this->assertNotWPError( wp_get_image_editor( $test_file ) ); + $editor = wp_get_image_editor( $test_file ); + if ( is_wp_error( $editor ) ) { + $this->markTestSkipped( $editor->get_error_message() ); + } $attachment_id = $this->factory->attachment->create_object( $test_file, @@ -552,7 +558,10 @@ class Tests_Image_Functions extends WP_UnitTestCase { $test_file = '/tmp/wordpress-gsoc-flyer.pdf'; copy( $orig_file, $test_file ); - $this->assertNotWPError( wp_get_image_editor( $test_file ) ); + $editor = wp_get_image_editor( $test_file ); + if ( is_wp_error( $editor ) ) { + $this->markTestSkipped( $editor->get_error_message() ); + } $attachment_id = $this->factory->attachment->create_object( $test_file, @@ -614,7 +623,10 @@ class Tests_Image_Functions extends WP_UnitTestCase { $pdf_path = '/tmp/test.pdf'; copy( DIR_TESTDATA . '/images/wordpress-gsoc-flyer.pdf', $pdf_path ); - $this->assertNotWPError( wp_get_image_editor( $pdf_path ) ); + $editor = wp_get_image_editor( $pdf_path ); + if ( is_wp_error( $editor ) ) { + $this->markTestSkipped( $editor->get_error_message() ); + } $attachment_id = $this->factory->attachment->create_object( $pdf_path,