From 6f9d8e6c692b8db451435651c4a64264480912b1 Mon Sep 17 00:00:00 2001 From: Adam Silverstein Date: Mon, 17 Mar 2025 17:26:41 +0000 Subject: [PATCH] Media: fix potentially failing Imagick PDF alpha channel test. Only test PDF alpha functionality when supported by the server. Props: adamsilverstein, swissspidy, antpb, sippis. Fixes #60798. git-svn-id: https://develop.svn.wordpress.org/trunk@60030 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/image/editorImagick.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/phpunit/tests/image/editorImagick.php b/tests/phpunit/tests/image/editorImagick.php index eb71d9ff47..8b00f3ac12 100644 --- a/tests/phpunit/tests/image/editorImagick.php +++ b/tests/phpunit/tests/image/editorImagick.php @@ -656,6 +656,11 @@ class Tests_Image_Editor_Imagick extends WP_Image_UnitTestCase { $this->markTestSkipped( 'Rendering PDFs is not supported on this system.' ); } + $version = Imagick::getVersion(); + if ( $version['versionNumber'] < 0x675 ) { + $this->markTestSkipped( 'The version of ImageMagick does not support removing alpha channels from PDFs.' ); + } + $test_file = DIR_TESTDATA . '/images/test-alpha.pdf'; $attachment_id = $this->factory->attachment->create_upload_object( $test_file ); $this->assertNotEmpty( $attachment_id, 'The attachment was not created before testing.' );