function ToolkitGdTest::setUp
Overrides KernelTestBase::setUp
File
- 
              core/tests/ Drupal/ KernelTests/ Core/ Image/ ToolkitGdTest.php, line 59 
Class
- ToolkitGdTest
- Tests for the GD image toolkit.
Namespace
Drupal\KernelTests\Core\ImageCode
protected function setUp() : void {
  parent::setUp();
  $this->installConfig([
    'system',
  ]);
  // Set the image factory service.
  $this->imageFactory = $this->container
    ->get('image.factory');
  $this->assertEquals('gd', $this->imageFactory
    ->getToolkitId(), 'The image factory is set to use the \'gd\' image toolkit.');
  // Prepare a directory for test file results.
  $this->directory = 'public://image_test';
  \Drupal::service('file_system')->prepareDirectory($this->directory, FileSystemInterface::CREATE_DIRECTORY);
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
