Skip to content

Commit

Permalink
Tests: Temporarily skip PDF tests if they fail due to ImageMagick per…
Browse files Browse the repository at this point in the history
…mission errors.

Merges [48338], [48341] to the 5.4 branch.

See #50573.

git-svn-id: https://develop.svn.wordpress.org/branches/5.4@48366 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Jul 7, 2020
1 parent 9c3d6f9 commit 0de3bb6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/phpunit/tests/image/functions.php
Expand Up @@ -423,6 +423,11 @@ public function test_wp_generate_attachment_metadata_pdf() {
$test_file = '/tmp/wordpress-gsoc-flyer.pdf';
copy( $orig_file, $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,
0,
Expand Down Expand Up @@ -488,6 +493,11 @@ public function test_crop_setting_for_pdf() {
$test_file = get_temp_dir() . 'wordpress-gsoc-flyer.pdf';
copy( $orig_file, $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,
0,
Expand Down Expand Up @@ -548,6 +558,11 @@ public function test_fallback_intermediate_image_sizes() {
$test_file = '/tmp/wordpress-gsoc-flyer.pdf';
copy( $orig_file, $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,
0,
Expand Down Expand Up @@ -608,6 +623,11 @@ public function test_pdf_preview_doesnt_overwrite_existing_jpeg() {
$pdf_path = '/tmp/test.pdf';
copy( DIR_TESTDATA . '/images/wordpress-gsoc-flyer.pdf', $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,
0,
Expand Down

0 comments on commit 0de3bb6

Please sign in to comment.