You are here

protected function ToolkitGdTest::checkRequirements in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php \Drupal\KernelTests\Core\Image\ToolkitGdTest::checkRequirements()

Check module requirements for the Drupal use case.

This method is assumed to override \PHPUnit\Framework\TestCase::checkRequirements().

Throws

\PHPUnit\Framework\SkippedTestError Thrown when the requirements are not met, and this test should be skipped. Callers should not catch this exception.

Overrides TestRequirementsTrait::checkRequirements

File

core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php, line 67

Class

ToolkitGdTest
Tests that core image manipulations work properly: scale, resize, rotate, crop, scale and crop, and desaturate.

Namespace

Drupal\KernelTests\Core\Image

Code

protected function checkRequirements() {

  // GD2 support is available.
  if (!function_exists('imagegd2')) {
    return [
      'Image manipulations for the GD toolkit cannot run because the GD toolkit is not available.',
    ];
  }
  return parent::checkRequirements();
}