diff --git a/tests/phpunit/tests/image/functions.php b/tests/phpunit/tests/image/functions.php
index e70d19c032..93f2fa1e3b 100644
--- a/tests/phpunit/tests/image/functions.php
+++ b/tests/phpunit/tests/image/functions.php
@@ -1152,4 +1152,32 @@ class Tests_Image_Functions extends WP_UnitTestCase {
 			),
 		);
 	}
+
+	/**
+	 * Test that PHP actually supports AVIF and not just pretend to.
+	 *
+	 * @link https://github.com/php/php-src/issues/12019
+	 *
+	 * @ticket 60628
+	 */
+	public function test_php_avif_support() {
+		if ( imagetypes() & IMG_AVIF ) {
+			$test_file = get_temp_dir() . 'php-gd.avif';
+
+			$result = @imageavif( imagecreatetruecolor( 16, 16 ), $test_file );
+
+			$this->assertTrue(
+				$result,
+				"imageavif() should return true."
+			);
+
+			$this->assertGreaterThan(
+				0,
+				filesize( $test_file ),
+				"filesize( '$test_file' ) should be greater than 0 bytes."
+			);
+
+			unlink( $test_file );
+		}
+	}
 }
