Security update for Core, with self-updated composer
[yaffs-website] / web / core / tests / Drupal / KernelTests / Core / Image / ToolkitGdTest.php
index bb2e481104cb00a6c0b370c20dbb5d82b4adc813..96ce7e011d73afcb268e975eccad9457fadc2047 100644 (file)
@@ -214,18 +214,22 @@ class ToolkitGdTest extends KernelTestBase {
     ];
 
     // 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/project/drupal/issues/2670966 is resolved.
+    if (function_exists('imagerotate') && (version_compare(phpversion(), '7.0.26') < 0)) {
       $operations += [
         'rotate_5' => [
           'function' => 'rotate',
-          'arguments' => ['degrees' => 5, 'background' => '#FF00FF'], // Fuchsia background.
+          // Fuchsia background.
+          'arguments' => ['degrees' => 5, 'background' => '#FF00FF'],
           'width' => 41,
           'height' => 23,
           'corners' => array_fill(0, 4, $this->fuchsia),
         ],
         'rotate_90' => [
           'function' => 'rotate',
-          'arguments' => ['degrees' => 90, 'background' => '#FF00FF'], // Fuchsia background.
+          // Fuchsia background.
+          'arguments' => ['degrees' => 90, 'background' => '#FF00FF'],
           'width' => 20,
           'height' => 40,
           'corners' => [$this->transparent, $this->red, $this->green, $this->blue],
@@ -365,7 +369,7 @@ class ToolkitGdTest extends KernelTestBase {
             if ($image->getToolkit()->getType() == $image_original_type || $corner != $this->transparent) {
               $correct_colors = $this->colorsAreEqual($color, $corner);
               $this->assertTrue($correct_colors, SafeMarkup::format('Image %file object after %action action has the correct color placement at corner %corner.',
-                ['%file'   => $file, '%action' => $op, '%corner' => $key]));
+                ['%file' => $file, '%action' => $op, '%corner' => $key]));
             }
           }
         }
@@ -381,7 +385,7 @@ class ToolkitGdTest extends KernelTestBase {
       $image = $this->imageFactory->get();
       $image->createNew(50, 20, image_type_to_extension($type, FALSE), '#ffff00');
       $file = 'from_null' . image_type_to_extension($type);
-      $file_path = $directory . '/' . $file ;
+      $file_path = $directory . '/' . $file;
       $this->assertEqual(50, $image->getWidth(), SafeMarkup::format('Image file %file has the correct width.', ['%file' => $file]));
       $this->assertEqual(20, $image->getHeight(), SafeMarkup::format('Image file %file has the correct height.', ['%file' => $file]));
       $this->assertEqual(image_type_to_mime_type($type), $image->getMimeType(), SafeMarkup::format('Image file %file has the correct MIME type.', ['%file' => $file]));
@@ -461,7 +465,7 @@ class ToolkitGdTest extends KernelTestBase {
     // Color at top-right pixel should be fully transparent while in memory,
     // fully opaque after flushing image to file.
     $file = 'image-test-no-transparent-color-set.gif';
-    $file_path = $directory . '/' . $file ;
+    $file_path = $directory . '/' . $file;
     // Create image.
     $image = $this->imageFactory->get();
     $image->createNew(50, 20, 'gif', NULL);