diff --git a/tests/phpunit/tests/functions.php b/tests/phpunit/tests/functions.php index 2c458d968c531..3294d15480034 100644 --- a/tests/phpunit/tests/functions.php +++ b/tests/phpunit/tests/functions.php @@ -1284,7 +1284,11 @@ public function test_wp_get_image_mime( $file, $expected ) { $this->markTestSkipped( 'The exif PHP extension is not loaded.' ); } - $this->assertSame( $expected, wp_get_image_mime( $file ) ); + if ( is_array( $expected ) ) { + $this->assertContains( wp_get_image_mime( $file ), $expected ); + } else { + $this->assertSame( $expected, wp_get_image_mime( $file ) ); + } } /** @@ -1360,7 +1364,8 @@ public function data_wp_get_image_mime() { // HEIC. array( DIR_TESTDATA . '/images/test-image.heic', - 'image/heic', + // In PHP 8.5, it returns 'image/heif'. Before that, it returns 'image/heic'. + array( 'image/heic', 'image/heif' ), ), );