Skip to content

Commit b00c8bf

Browse files
Tests: Temporarily skip PDF tests if they fail due to ImageMagick permission errors.
Merges [48338], [48341] to the 5.0 branch. See #50573. git-svn-id: https://develop.svn.wordpress.org/branches/5.0@48486 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 99d5878 commit b00c8bf

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/phpunit/tests/image/functions.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,11 @@ public function test_wp_generate_attachment_metadata_pdf() {
371371
$test_file = '/tmp/wordpress-gsoc-flyer.pdf';
372372
copy( $orig_file, $test_file );
373373

374+
$editor = wp_get_image_editor( $test_file );
375+
if ( is_wp_error( $editor ) ) {
376+
$this->markTestSkipped( $editor->get_error_message() );
377+
}
378+
374379
$attachment_id = $this->factory->attachment->create_object( $test_file, 0, array(
375380
'post_mime_type' => 'application/pdf',
376381
) );
@@ -432,6 +437,11 @@ public function test_crop_setting_for_pdf() {
432437
$test_file = get_temp_dir() . 'wordpress-gsoc-flyer.pdf';
433438
copy( $orig_file, $test_file );
434439

440+
$editor = wp_get_image_editor( $test_file );
441+
if ( is_wp_error( $editor ) ) {
442+
$this->markTestSkipped( $editor->get_error_message() );
443+
}
444+
435445
$attachment_id = $this->factory->attachment->create_object(
436446
$test_file, 0, array(
437447
'post_mime_type' => 'application/pdf',
@@ -490,6 +500,11 @@ public function test_fallback_intermediate_image_sizes() {
490500
$test_file = '/tmp/wordpress-gsoc-flyer.pdf';
491501
copy( $orig_file, $test_file );
492502

503+
$editor = wp_get_image_editor( $test_file );
504+
if ( is_wp_error( $editor ) ) {
505+
$this->markTestSkipped( $editor->get_error_message() );
506+
}
507+
493508
$attachment_id = $this->factory->attachment->create_object( $test_file, 0, array(
494509
'post_mime_type' => 'application/pdf',
495510
) );
@@ -545,6 +560,11 @@ public function test_pdf_preview_doesnt_overwrite_existing_jpeg() {
545560
$pdf_path = '/tmp/test.pdf';
546561
copy( DIR_TESTDATA . '/images/wordpress-gsoc-flyer.pdf', $pdf_path );
547562

563+
$editor = wp_get_image_editor( $test_file );
564+
if ( is_wp_error( $editor ) ) {
565+
$this->markTestSkipped( $editor->get_error_message() );
566+
}
567+
548568
$attachment_id = $this->factory->attachment->create_object( $pdf_path, 0, array(
549569
'post_mime_type' => 'application/pdf',
550570
) );

0 commit comments

Comments
 (0)