summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Rothstein2017-11-30 16:22:00 -0500
committerDavid Rothstein2017-11-30 16:22:00 -0500
commit6336b7177eaf1b93bc8694056b53ab8f22c274f5 (patch)
tree73a09eee641f438bf09bae5f68f833a4e947a29b
parent0a1851cfd542ba8b968bec38b72524f28fc87a87 (diff)
Issue #2918570 by xjm, David_Rothstein: Hotfix for ImageToolkitGdTestCase failing on newer PHP 7 and 7.1 releases7.x
-rw-r--r--modules/simpletest/tests/image.test8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/simpletest/tests/image.test b/modules/simpletest/tests/image.test
index 7ca1d3a..4156964 100644
--- a/modules/simpletest/tests/image.test
+++ b/modules/simpletest/tests/image.test
@@ -335,7 +335,9 @@ class ImageToolkitGdTestCase extends DrupalWebTestCase {
);
// Systems using non-bundled GD2 don't have imagerotate. Test if available.
- if (function_exists('imagerotate')) {
+ // @todo Remove the version check once https://www.drupal.org/node/2918570
+ // is resolved.
+ if (function_exists('imagerotate') && (version_compare(PHP_VERSION, '7.0.26', '<') || (version_compare(PHP_VERSION, '7.1', '>=') && version_compare(PHP_VERSION, '7.1.12', '<')))) {
$operations += array(
'rotate_90' => array(
'function' => 'rotate',
@@ -357,8 +359,8 @@ class ImageToolkitGdTestCase extends DrupalWebTestCase {
// See https://bugs.php.net/bug.php?id=65148.
// For the 40x20 test images, the dimensions resulting from rotation will
// be 1 pixel smaller in both width and height in PHP 5.5 and above.
- // @todo: If and when the PHP bug gets solved, add an upper limit
- // version check.
+ // @todo: The PHP bug was fixed in PHP 7.0.26 and 7.1.12. Change the code
+ // below to reflect that in https://www.drupal.org/node/2918570.
if (version_compare(PHP_VERSION, '5.5', '>=')) {
$operations += array(
'rotate_5' => array(