Skip to content

Commit 294dca8

Browse files
committed
Expect additional fields in PHP >= 8.5
1 parent 1f3631e commit 294dca8

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

tests/phpunit/tests/functions.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1575,8 +1575,26 @@ public function test_wp_getimagesize_heic() {
15751575
1180,
15761576
IMAGETYPE_HEIC,
15771577
'width="1180" height="1180"',
1578-
'mime' => 'image/heic',
15791578
);
1579+
1580+
/*
1581+
* As of PHP 8.5.0, getimagesize() supports HEIF/HEIC files.
1582+
*/
1583+
if ( PHP_VERSION_ID >= 80500 ) {
1584+
$expected = array_merge(
1585+
$expected,
1586+
array(
1587+
'bits' => 8,
1588+
'channels' => 3,
1589+
'mime' => 'image/heif',
1590+
'width_unit' => 'px',
1591+
'height_unit' => 'px',
1592+
)
1593+
);
1594+
} else {
1595+
$expected['mime'] = 'image/heic';
1596+
}
1597+
15801598
$result = wp_getimagesize( $file );
15811599
$this->assertSame( $expected, $result );
15821600
}

0 commit comments

Comments
 (0)