You are here

protected function ToolkitTestBase::getImage in Drupal 8

Same name in this branch
  1. 8 core/tests/Drupal/FunctionalTests/Image/ToolkitTestBase.php \Drupal\FunctionalTests\Image\ToolkitTestBase::getImage()
  2. 8 core/modules/system/src/Tests/Image/ToolkitTestBase.php \Drupal\system\Tests\Image\ToolkitTestBase::getImage()
Same name and namespace 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.

2 calls to ToolkitTestBase::getImage()
ToolkitTest::testLoad in core/tests/Drupal/FunctionalTests/Image/ToolkitTest.php
Tests Image's methods.
ToolkitTestBase::setUp in core/tests/Drupal/FunctionalTests/Image/ToolkitTestBase.php

File

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

Class

ToolkitTestBase
Base class for image manipulation testing.

Namespace

Drupal\FunctionalTests\Image

Code

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