function ToolkitTestBase::setUp

Same name in other branches
  1. 8.9.x core/modules/system/src/Tests/Image/ToolkitTestBase.php \Drupal\system\Tests\Image\ToolkitTestBase::setUp()
  2. 8.9.x core/tests/Drupal/FunctionalTests/Image/ToolkitTestBase.php \Drupal\FunctionalTests\Image\ToolkitTestBase::setUp()

Overrides BrowserTestBase::setUp

File

core/tests/Drupal/FunctionalTests/Image/ToolkitTestBase.php, line 58

Class

ToolkitTestBase
Base class for image manipulation testing.

Namespace

Drupal\FunctionalTests\Image

Code

protected function setUp() {
    parent::setUp();
    // Set the image factory service.
    $this->imageFactory = $this->container
        ->get('image.factory');
    // Pick a file for testing.
    $file = current($this->drupalGetTestFiles('image'));
    $this->file = $file->uri;
    // Setup a dummy image to work with.
    $this->image = $this->getImage();
    // Clear out any hook calls.
    $this->imageTestReset();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.