summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Beccati <mbeccati@php.net>2014-09-03 09:45:17 +0200
committerMatteo Beccati <mbeccati@php.net>2014-09-03 09:45:17 +0200
commitd1b0066df756396ade428569debe3816fc196683 (patch)
tree32e645e6f19c5411003cb015177ce561c0ce840e
parentb0f0211b1ae695809f72a8a241649cda6ecd38bb (diff)
parent627704b38e0c4ded81fb90524171546d77e2500e (diff)
downloadphp-git-d1b0066df756396ade428569debe3816fc196683.tar.gz
Merge branch 'PHP-5.6'
* PHP-5.6: Fixed test with freetype >= 2.4.12
-rw-r--r--ext/gd/tests/bug48801_1.phpt5
-rw-r--r--ext/gd/tests/bug48801_2.phpt25
2 files changed, 28 insertions, 2 deletions
diff --git a/ext/gd/tests/bug48801_1.phpt b/ext/gd/tests/bug48801_1.phpt
index 11af80cd4b..ef2aa1dba7 100644
--- a/ext/gd/tests/bug48801_1.phpt
+++ b/ext/gd/tests/bug48801_1.phpt
@@ -1,12 +1,13 @@
--TEST--
-Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.10
+Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.10 and < 2.4.12
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
if(!function_exists('imageftbbox')) die('skip imageftbbox() not available');
include dirname(__FILE__) . '/func.inc';
- if(version_compare(get_freetype_version(), '2.4.10') == -1) die('skip for freetype >= 2.4.10');
+ if(version_compare(get_freetype_version(), '2.4.10') < 0) die('skip for freetype >= 2.4.10');
+ if(version_compare(get_freetype_version(), '2.4.12') >= 0) die('skip for freetype < 2.4.12');
?>
--FILE--
<?php
diff --git a/ext/gd/tests/bug48801_2.phpt b/ext/gd/tests/bug48801_2.phpt
new file mode 100644
index 0000000000..b2a719fa02
--- /dev/null
+++ b/ext/gd/tests/bug48801_2.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.12
+--SKIPIF--
+<?php
+ if(!extension_loaded('gd')){ die('skip gd extension not available'); }
+ if(!function_exists('imageftbbox')) die('skip imageftbbox() not available');
+
+ include dirname(__FILE__) . '/func.inc';
+ if(version_compare(get_freetype_version(), '2.4.12') < 0) die('skip for freetype >= 2.4.12');
+?>
+--FILE--
+<?php
+$cwd = dirname(__FILE__);
+$font = "$cwd/Tuffy.ttf";
+$bbox = imageftbbox(50, 0, $font, "image");
+echo '(' . $bbox[0] . ', ' . $bbox[1] . ")\n";
+echo '(' . $bbox[2] . ', ' . $bbox[3] . ")\n";
+echo '(' . $bbox[4] . ', ' . $bbox[5] . ")\n";
+echo '(' . $bbox[6] . ', ' . $bbox[7] . ")\n";
+?>
+--EXPECTF--
+(-1, 15)
+(155, 15)
+(155, -48)
+(-1, -48)