function ToolkitTestBase::setUp

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

Overrides BrowserTestBase::setUp

1 call to ToolkitTestBase::setUp()
ImageEffectsTest::setUp in core/modules/image/tests/src/Functional/ImageEffectsTest.php
1 method overrides ToolkitTestBase::setUp()
ImageEffectsTest::setUp in core/modules/image/tests/src/Functional/ImageEffectsTest.php

File

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

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.