diff --git a/tests/phpunit/tests/image/functions.php b/tests/phpunit/tests/image/functions.php
index e70d19c032..93f2fa1e3b 100644
|
a
|
b
|
class Tests_Image_Functions extends WP_UnitTestCase { |
| 1152 | 1152 | ), |
| 1153 | 1153 | ); |
| 1154 | 1154 | } |
| | 1155 | |
| | 1156 | /** |
| | 1157 | * Test that PHP actually supports AVIF and not just pretend to. |
| | 1158 | * |
| | 1159 | * @link https://github.com/php/php-src/issues/12019 |
| | 1160 | * |
| | 1161 | * @ticket 60628 |
| | 1162 | */ |
| | 1163 | public function test_php_avif_support() { |
| | 1164 | if ( imagetypes() & IMG_AVIF ) { |
| | 1165 | $test_file = get_temp_dir() . 'php-gd.avif'; |
| | 1166 | |
| | 1167 | $result = @imageavif( imagecreatetruecolor( 16, 16 ), $test_file ); |
| | 1168 | |
| | 1169 | $this->assertTrue( |
| | 1170 | $result, |
| | 1171 | "imageavif() should return true." |
| | 1172 | ); |
| | 1173 | |
| | 1174 | $this->assertGreaterThan( |
| | 1175 | 0, |
| | 1176 | filesize( $test_file ), |
| | 1177 | "filesize( '$test_file' ) should be greater than 0 bytes." |
| | 1178 | ); |
| | 1179 | |
| | 1180 | unlink( $test_file ); |
| | 1181 | } |
| | 1182 | } |
| 1155 | 1183 | } |