From 3c4cdf75bb7b081184cc57b795e8b692ca637391 Mon Sep 17 00:00:00 2001 From: Muhibul Haque Date: Sat, 7 Nov 2026 12:06:36 +0600 Subject: [PATCH 1/2] Tests: Cover wp_is_heic_image_mime_type(). See #65819. Props devmuhib009. --- .../tests/functions/wpIsHeicImageMimeType.php | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 tests/phpunit/tests/functions/wpIsHeicImageMimeType.php diff --git a/tests/phpunit/tests/functions/wpIsHeicImageMimeType.php b/tests/phpunit/tests/functions/wpIsHeicImageMimeType.php new file mode 100644 index 0000000000000..60a3b34200120 --- /dev/null +++ b/tests/phpunit/tests/functions/wpIsHeicImageMimeType.php @@ -0,0 +1,69 @@ +assertTrue( wp_is_heic_image_mime_type( $mime_type ) ); + } + + /** + * Data provider of valid HEIC/HEIF MIME types. + * + * @return array[] + */ + public static function data_valid_heic_mime_types() { + return array( + 'image/heic' => array( 'image/heic' ), + 'image/heif' => array( 'image/heif' ), + 'image/heic-sequence' => array( 'image/heic-sequence' ), + 'image/heif-sequence' => array( 'image/heif-sequence' ), + ); + } + + /** + * Tests that non-HEIC mime types return false. + * + * @ticket 65819 + * + * @dataProvider data_non_heic_mime_types + * + * @param string $mime_type The MIME type to check. + */ + public function test_wp_is_heic_image_mime_type_false( $mime_type ) { + $this->assertFalse( wp_is_heic_image_mime_type( $mime_type ) ); + } + + /** + * Data provider of non-HEIC MIME types. + * + * @return array[] + */ + public static function data_non_heic_mime_types() { + return array( + 'image/jpeg' => array( 'image/jpeg' ), + 'image/png' => array( 'image/png' ), + 'image/webp' => array( 'image/webp' ), + 'image/avif' => array( 'image/avif' ), + 'image/gif' => array( 'image/gif' ), + 'application/pdf' => array( 'application/pdf' ), + 'empty string' => array( '' ), + ); + } +} From 7bf558e55b84018afbaf98a9c08334769e2087bb Mon Sep 17 00:00:00 2001 From: Muhibul Haque Date: Sat, 7 Nov 2026 20:51:37 +0600 Subject: [PATCH 2/2] Tests: Cover wp_is_heic_image_mime_type(). See #66624. Props devmuhib009. --- tests/phpunit/tests/functions/wpIsHeicImageMimeType.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/functions/wpIsHeicImageMimeType.php b/tests/phpunit/tests/functions/wpIsHeicImageMimeType.php index 60a3b34200120..5d999c5bf4c78 100644 --- a/tests/phpunit/tests/functions/wpIsHeicImageMimeType.php +++ b/tests/phpunit/tests/functions/wpIsHeicImageMimeType.php @@ -13,7 +13,7 @@ class Tests_Functions_WpIsHeicImageMimeType extends WP_UnitTestCase { /** * Tests that valid HEIC and HEIF mime types return true. * - * @ticket 65819 + * @ticket 66624 * * @dataProvider data_valid_heic_mime_types * @@ -40,7 +40,7 @@ public static function data_valid_heic_mime_types() { /** * Tests that non-HEIC mime types return false. * - * @ticket 65819 + * @ticket 66624 * * @dataProvider data_non_heic_mime_types *