function ToolkitTestBase::getImage

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

Sets up an image with the custom toolkit.

Return value

\Drupal\Core\Image\ImageInterface The image object.

1 call to ToolkitTestBase::getImage()
ToolkitTestBase::setUp in core/modules/system/src/Tests/Image/ToolkitTestBase.php
Sets up a Drupal site for running functional and integration tests.

File

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

Class

ToolkitTestBase
Base class for image manipulation testing.

Namespace

Drupal\system\Tests\Image

Code

protected function getImage() {
    $image = $this->imageFactory
        ->get($this->file, 'test');
    $this->assertTrue($image->isValid(), 'Image file was parsed.');
    return $image;
}

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