From 80ca807a96be66b63a56a75cdc3e28cf73b7fee5 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 4 Jun 2022 18:03:56 +0000 Subject: [PATCH] Tests: Don't overwrite image metadata in a `wp_calculate_image_srcset()` test for zero width. This was unnecessarily replacing the original image metadata with a scaled version, leading to a few leftover images with the `-scaled` suffix in the `wp-content/uploads` directory. Follow-up to [35412]. See #55652. git-svn-id: https://develop.svn.wordpress.org/trunk@53465 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/media.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/phpunit/tests/media.php b/tests/phpunit/tests/media.php index 7ae136982d..25e992abfd 100644 --- a/tests/phpunit/tests/media.php +++ b/tests/phpunit/tests/media.php @@ -1829,9 +1829,8 @@ EOF; * @requires function imagejpeg */ public function test_wp_calculate_image_srcset_no_width() { - $file = get_attached_file( self::$large_id ); $image_url = wp_get_attachment_image_url( self::$large_id, 'medium' ); - $image_meta = wp_generate_attachment_metadata( self::$large_id, $file ); + $image_meta = wp_get_attachment_metadata( self::$large_id ); $size_array = array( 0, 0 );