diff --git a/src/Tests/ToolkitImagemagickTest.php b/tests/src/Functional/ToolkitImagemagickTest.php
similarity index 88%
rename from src/Tests/ToolkitImagemagickTest.php
rename to tests/src/Functional/ToolkitImagemagickTest.php
index 54f6722..c47ae9a 100644
--- a/src/Tests/ToolkitImagemagickTest.php
+++ b/tests/src/Functional/ToolkitImagemagickTest.php
@@ -1,16 +1,19 @@
 <?php
 
-namespace Drupal\imagemagick\Tests;
+namespace Drupal\Tests\imagemagick\Functional;
 
 use Drupal\Core\Image\ImageInterface;
-use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\TestFileCreationTrait;
+use Drupal\Tests\BrowserTestBase;
 
 /**
  * Tests that core image manipulations work properly through Imagemagick.
  *
  * @group Imagemagick
  */
-class ToolkitImagemagickTest extends WebTestBase {
+class ToolkitImagemagickTest extends BrowserTestBase {
+
+  use TestFileCreationTrait;
 
   /**
    * The image factory service.
@@ -27,16 +30,19 @@ class ToolkitImagemagickTest extends WebTestBase {
   protected $testDirectory;
 
   // Colors that are used in testing.
-  protected $black       = [0, 0, 0, 0];
-  protected $red         = [255, 0, 0, 0];
-  protected $green       = [0, 255, 0, 0];
-  protected $blue        = [0, 0, 255, 0];
-  protected $yellow      = [255, 255, 0, 0];
-  protected $white       = [255, 255, 255, 0];
-  protected $transparent = [0, 0, 0, 127];
-  // Used as rotate background colors.
-  protected $fuchsia            = [255, 0, 255, 0];
+  // @codingStandardsIgnoreStart
+  protected $black             = [  0,   0,   0,   0];
+  protected $red               = [255,   0,   0,   0];
+  protected $green             = [  0, 255,   0,   0];
+  protected $blue              = [  0,   0, 255,   0];
+  protected $yellow            = [255, 255,   0,   0];
+  protected $fuchsia           = [255,   0, 255,   0];
+  protected $cyan              = [  0, 255, 255,   0];
+  protected $white             = [255, 255, 255,   0];
+  protected $grey              = [128, 128, 128,   0];
+  protected $transparent       = [  0,   0,   0, 127];
   protected $rotateTransparent = [255, 255, 255, 127];
+  // @codingStandardsIgnoreEnd
 
   protected $width = 40;
   protected $height = 20;
@@ -58,7 +64,7 @@ class ToolkitImagemagickTest extends WebTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  public function setUp() {
     parent::setUp();
 
     // Create an admin user.
@@ -75,33 +81,52 @@ class ToolkitImagemagickTest extends WebTestBase {
   }
 
   /**
-   * Function for finding a pixel's RGBa values.
+   * Provides data for testManipulations.
+   *
+   * @return array[]
+   *   A simple array of simple arrays, each having the following elements:
+   *   - binaries to use for testing.
    */
-  protected function getPixelColor(ImageInterface $image, $x, $y) {
-    $toolkit = $image->getToolkit();
-    $color_index = imagecolorat($toolkit->getResource(), $x, $y);
-
-    $transparent_index = imagecolortransparent($toolkit->getResource());
-    if ($color_index == $transparent_index) {
-      return [0, 0, 0, 127];
-    }
-
-    return array_values(imagecolorsforindex($toolkit->getResource(), $color_index));
+  public function providerManipulationTest() {
+    return [
+      ['imagemagick'],
+      ['graphicsmagick'],
+    ];
   }
 
   /**
    * Test image toolkit operations.
+   *
+   * Since PHP can't visually check that our images have been manipulated
+   * properly, build a list of expected color values for each of the corners and
+   * the expected height and widths for the final images.
+   *
+   * @param string $binaries
+   *   The graphics package binaries to use for testing.
+   *
+   * @dataProvider providerManipulationTest
    */
-  public function testManipulations() {
+  public function testManipulations($binaries) {
     // Change the toolkit.
     \Drupal::configFactory()->getEditable('system.image')
       ->set('toolkit', 'imagemagick')
       ->save();
+
+    // Execute tests with selected binaries.
+    // The test can only be executed if binaries are available on the shell
+    // path.
     \Drupal::configFactory()->getEditable('imagemagick.settings')
       ->set('debug', TRUE)
-      ->set('binaries', 'imagemagick')
+      ->set('binaries', $binaries)
       ->set('quality', 100)
       ->save();
+    $status = \Drupal::service('image.toolkit.manager')->createInstance('imagemagick')->checkPath('');
+    if (!empty($status['errors'])) {
+      // Bots running automated test on d.o. do not have binaries installed,
+      // so the test will be skipped; it can be run locally where binaries are
+      // installed.
+      $this->markTestSkipped("Tests for '{$binaries}' cannot run because the binaries are not available on the shell path.");
+    }
 
     // Set the toolkit on the image factory.
     $this->imageFactory->setToolkitId('imagemagick');
@@ -109,46 +134,7 @@ class ToolkitImagemagickTest extends WebTestBase {
     // Test that the image factory is set to use the Imagemagick toolkit.
     $this->assertEqual($this->imageFactory->getToolkitId(), 'imagemagick', 'The image factory is set to use the \'imagemagick\' image toolkit.');
 
-    // Execute tests with ImageMagick.
-    // The test can only be executed if ImageMagick's 'convert' is available
-    // on the shell path.
-    $status = \Drupal::service('image.toolkit.manager')->createInstance('imagemagick')->checkPath('');
-    if (!empty($status['errors'])) {
-      // Bots running automated test on d.o. do not have ImageMagick
-      // installed, so there's no purpose to try and run this test there;
-      // it can be run locally where ImageMagick is installed.
-      debug('Tests for ImageMagick cannot run because the \'convert\' binary is not available on the shell path.');
-    }
-    else {
-      $this->doTestManipulations();
-    }
-
-    // Execute tests with GraphicsMagick.
-    // The test can only be executed if GraphicsMagick's 'gm' is available on
-    // the shell path.
-    \Drupal::configFactory()->getEditable('imagemagick.settings')
-      ->set('binaries', 'graphicsmagick')
-      ->save();
-    $status = \Drupal::service('image.toolkit.manager')->createInstance('imagemagick')->checkPath('');
-    if (!empty($status['errors'])) {
-      // Bots running automated test on d.o. do not have GraphicsMagick
-      // installed, so there's no purpose to try and run this test there;
-      // it can be run locally where GraphicsMagick is installed.
-      debug('Tests for GraphicsMagick cannot run because the \'gm\' binary is not available on the shell path.');
-    }
-    else {
-      $this->doTestManipulations();
-    }
-  }
-
-  /**
-   * Test image toolkit operations with selected package.
-   *
-   * Since PHP can't visually check that our images have been manipulated
-   * properly, build a list of expected color values for each of the corners and
-   * the expected height and widths for the final images.
-   */
-  public function doTestManipulations() {
+    // Prepare directory.
     file_unmanaged_delete_recursive($this->testDirectory);
     file_prepare_directory($this->testDirectory, FILE_CREATE_DIRECTORY);
 
@@ -309,7 +295,7 @@ class ToolkitImagemagickTest extends WebTestBase {
     ];
 
     // Prepare a copy of test files.
-    $this->drupalGetTestFiles('image');
+    $this->getTestFiles('image');
 
     foreach ($files as $file) {
       $image_uri = 'public://' . $file;
@@ -338,7 +324,6 @@ class ToolkitImagemagickTest extends WebTestBase {
         if ($package === 'graphicsmagick') {
           // @todo Issues with crop on GIF files, investigate.
           if (in_array($file, ['image-test.gif', 'image-test-no-transparency.gif']) && in_array($op, ['crop', 'scale_and_crop'])) {
-            debug("Skip GD check on $file, operation $op.");
             continue;
           }
         }
@@ -415,7 +400,6 @@ class ToolkitImagemagickTest extends WebTestBase {
             }
             $color = $this->getPixelColor($image, $x, $y);
             $correct_colors = $this->colorsAreClose($color, $corner, $values['tolerance']);
-            $this->assertTrue($correct_colors, "Image '$file' object after '$op' action has the correct color placement at corner $key.");
           }
         }
       }
@@ -654,31 +638,43 @@ class ToolkitImagemagickTest extends WebTestBase {
   }
 
   /**
+   * Function for finding a pixel's RGBa values.
+   */
+  protected function getPixelColor(ImageInterface $image, $x, $y) {
+    $toolkit = $image->getToolkit();
+    $color_index = imagecolorat($toolkit->getResource(), $x, $y);
+
+    $transparent_index = imagecolortransparent($toolkit->getResource());
+    if ($color_index == $transparent_index) {
+      return array(0, 0, 0, 127);
+    }
+
+    return array_values(imagecolorsforindex($toolkit->getResource(), $color_index));
+  }
+
+  /**
    * Function to compare two colors by RGBa, within a tolerance.
    *
    * Very basic, just compares the sum of the squared differences for each of
-   * the R, G, B, a components of two colors against a 'tolerance' value.
+   * the R, G, B, A components of two colors against a 'tolerance' value.
    *
-   * @param int[] $color_a
-   *   An RGBa array.
-   * @param int[] $color_b
-   *   An RGBa array.
+   * @param int[] $actual
+   *   The actual RGBA array.
+   * @param int[] $expected
+   *   The expected RGBA array.
    * @param int $tolerance
-   *   The accepteable difference between the colors.
+   *   The acceptable difference between the colors.
    *
    * @return bool
    *   TRUE if the colors differences are within tolerance, FALSE otherwise.
    */
-  protected function colorsAreClose(array $color_a, array $color_b, $tolerance) {
+  protected function colorsAreClose(array $actual, array $expected, $tolerance) {
     // Fully transparent colors are equal, regardless of RGB.
-    if ($color_a[3] == 127 && $color_b[3] == 127) {
+    if ($actual[3] == 127 && $expected[3] == 127) {
       return TRUE;
     }
-    $distance = pow(($color_a[0] - $color_b[0]), 2) + pow(($color_a[1] - $color_b[1]), 2) + pow(($color_a[2] - $color_b[2]), 2) + pow(($color_a[3] - $color_b[3]), 2);
-    if ($distance > $tolerance) {
-      debug("Color A: {" . implode(',', $color_a) . "}, Color B: {" . implode(',', $color_b) . "}, Distance: " . $distance . ", Tolerance: " . $tolerance);
-      return FALSE;
-    }
+    $distance = pow(($actual[0] - $expected[0]), 2) + pow(($actual[1] - $expected[1]), 2) + pow(($actual[2] - $expected[2]), 2) + pow(($actual[3] - $expected[3]), 2);
+    $this->assertLessThanOrEqual($tolerance, $distance, "Actual: {" . implode(',', $actual) . "}, Expected: {" . implode(',', $expected) . "}, Distance: " . $distance . ", Tolerance: " . $tolerance);
     return TRUE;
   }
 
