From e20ef8b8f03a241e53df3fc4ca2deb584f1d8661 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Mon, 29 Sep 2025 18:46:12 +0200 Subject: [PATCH] PHP 8.5: Fix HEIF mime type assertion in test --- tests/phpunit/tests/functions.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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' ), ), );