Make WordPress Core


Ignore:
Timestamp:
06/04/2022 06:03:56 PM (2 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/media.php

    r53464 r53465  
    18301830     */
    18311831    public function test_wp_calculate_image_srcset_no_width() {
    1832         $file       = get_attached_file( self::$large_id );
    18331832        $image_url  = wp_get_attachment_image_url( self::$large_id, 'medium' );
    1834         $image_meta = wp_generate_attachment_metadata( self::$large_id, $file );
     1833        $image_meta = wp_get_attachment_metadata( self::$large_id );
    18351834
    18361835        $size_array = array( 0, 0 );
Note: See TracChangeset for help on using the changeset viewer.