function ToolkitTestBase::setUp

Same name in this branch
  1. 8.9.x core/tests/Drupal/FunctionalTests/Image/ToolkitTestBase.php \Drupal\FunctionalTests\Image\ToolkitTestBase::setUp()
Same name in other branches
  1. 9 core/tests/Drupal/FunctionalTests/Image/ToolkitTestBase.php \Drupal\FunctionalTests\Image\ToolkitTestBase::setUp()

Overrides WebTestBase::setUp

File

core/modules/system/src/Tests/Image/ToolkitTestBase.php, line 48

Class

ToolkitTestBase
Base class for image manipulation testing.

Namespace

Drupal\system\Tests\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.