mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
The test failure is not particularly related to Travis, but rather is
caused by the GD font file to only be suitable for platforms where
`int` stores 32bit values in little endian byte order. This platform
dependence is documented in the source code[1]. Thus we fix the skip
condition and skip reason accordingly.
An alternative would be to dynamically create the font file just before
running the test, but that appears to be overkill.
[1] <d59691c02f/ext/gd/gd.c (L545-L556)>
Closes GH-14922.
19 lines
513 B
PHP
19 lines
513 B
PHP
--TEST--
|
|
GH-13082 - imagefontwidth/height unexpectedly throwing an exception on a valid GdFont object.
|
|
--EXTENSIONS--
|
|
gd
|
|
--SKIPIF--
|
|
<?php if (pack('i', 0x01020304) !== "\x04\x03\x02\x01") die('skip unsupported platform'); ?>
|
|
--FILE--
|
|
<?php
|
|
$font = imageloadfont(__DIR__ . "/gh13082.gdf");
|
|
if ($font === false) die("imageloadfont failed");
|
|
if (!($font instanceof GdFont)) die("invalid gd font");
|
|
|
|
var_dump(imagefontwidth($font));
|
|
var_dump(imagefontheight($font));
|
|
?>
|
|
--EXPECT--
|
|
int(12)
|
|
int(20)
|