Make WordPress Core


Ignore:
Timestamp:
09/29/2025 05:58:54 PM (12 months ago)
Author:
swissspidy
Message:

Media: Fix HEIF mime type assertion in test for PHP 8.5.

In PHP 8.5, the test image's mime type is now detected as image/heif, not image/heic.

Props swissspidy, adamsilverstein.
Fixes #64050.

File:
1 edited

Legend:

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

    r60251 r60810  
    12851285                }
    12861286
    1287                 $this->assertSame( $expected, wp_get_image_mime( $file ) );
     1287                if ( is_array( $expected ) ) {
     1288                        $this->assertContains( wp_get_image_mime( $file ), $expected );
     1289                } else {
     1290                        $this->assertSame( $expected, wp_get_image_mime( $file ) );
     1291                }
    12881292        }
    12891293
    … …  
    13611365                        array(
    13621366                                DIR_TESTDATA . '/images/test-image.heic',
    1363                                 'image/heic',
     1367                                // In PHP 8.5, it returns 'image/heif'. Before that, it returns 'image/heic'.
     1368                                array( 'image/heic', 'image/heif' ),
    13641369                        ),
    13651370                );
Note: See TracChangeset for help on using the changeset viewer.