From 5730b983b81aa1e518c9272f32daf3aafd942e95 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 25 Sep 2020 01:43:19 +0000 Subject: [PATCH] Tests: Require `imagejpeg()` function in some more media tests. This outputs a proper message if the requirement is not met, instead of an obscure PHP error further in the test. These tests rely on multiple resized copies of a test JPEG image being generated and available. Follow-up to [49010], [49024], [49025]. See #50639, #50640. git-svn-id: https://develop.svn.wordpress.org/trunk@49045 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/media.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/phpunit/tests/media.php b/tests/phpunit/tests/media.php index 0e8870f6b6..c1408cc565 100644 --- a/tests/phpunit/tests/media.php +++ b/tests/phpunit/tests/media.php @@ -1467,6 +1467,7 @@ EOF; /** * @ticket 33641 + * @requires function imagejpeg */ function test_wp_calculate_image_srcset() { $_wp_additional_image_sizes = wp_get_additional_image_sizes(); @@ -1514,6 +1515,7 @@ EOF; /** * @ticket 33641 + * @requires function imagejpeg */ function test_wp_calculate_image_srcset_no_date_uploads() { $_wp_additional_image_sizes = wp_get_additional_image_sizes(); @@ -1570,6 +1572,7 @@ EOF; /** * @ticket 33641 + * @requires function imagejpeg */ function test_wp_calculate_image_srcset_with_edits() { // For this test we're going to mock metadata changes from an edit. @@ -1603,6 +1606,7 @@ EOF; /** * @ticket 35106 + * @requires function imagejpeg */ function test_wp_calculate_image_srcset_with_absolute_path_in_meta() { $_wp_additional_image_sizes = wp_get_additional_image_sizes(); @@ -1900,6 +1904,7 @@ EOF; /** * @ticket 33641 + * @requires function imagejpeg */ function test_wp_get_attachment_image_srcset() { $_wp_additional_image_sizes = wp_get_additional_image_sizes(); @@ -1990,6 +1995,7 @@ EOF; /** * @ticket 33641 + * @requires function imagejpeg */ function test_wp_calculate_image_sizes() { // Test sizes against the default WP sizes. @@ -2013,6 +2019,7 @@ EOF; /** * @ticket 33641 + * @requires function imagejpeg */ function test_wp_filter_content_tags_srcset_sizes() { $image_meta = wp_get_attachment_metadata( self::$large_id ); @@ -2174,6 +2181,7 @@ EOF; /** * @ticket 35045 * @ticket 33641 + * @requires function imagejpeg */ function test_wp_filter_content_tags_schemes() { $image_meta = wp_get_attachment_metadata( self::$large_id ); @@ -2624,6 +2632,7 @@ EOF; /** * @ticket 50367 + * @requires function imagejpeg */ function test_wp_filter_content_tags_width_height() { $image_meta = wp_get_attachment_metadata( self::$large_id ); @@ -2669,6 +2678,7 @@ EOF; /** * @ticket 44427 * @ticket 50367 + * @requires function imagejpeg */ function test_wp_filter_content_tags_loading_lazy() { $image_meta = wp_get_attachment_metadata( self::$large_id );