You are here

protected function BlazyCreationTestTrait::setUpRealImage in Blazy 8

Same name and namespace in other branches
  1. 8.2 tests/src/Traits/BlazyCreationTestTrait.php \Drupal\Tests\blazy\Traits\BlazyCreationTestTrait::setUpRealImage()

Set up dummy image.

4 calls to BlazyCreationTestTrait::setUpRealImage()
BlazyFormatterTest::setUp in tests/src/Kernel/BlazyFormatterTest.php
Set the default field storage backend for fields created during tests.
BlazyManagerTest::setUp in tests/src/Kernel/BlazyManagerTest.php
Set the default field storage backend for fields created during tests.
BlazyViewsFileTest::buildContents in tests/src/Kernel/Views/BlazyViewsFileTest.php
Build contents.
BlazyViewsTestBase::setUp in tests/src/Kernel/Views/BlazyViewsTestBase.php

File

tests/src/Traits/BlazyCreationTestTrait.php, line 479

Class

BlazyCreationTestTrait
A Trait common for Blazy tests.

Namespace

Drupal\Tests\blazy\Traits

Code

protected function setUpRealImage() {
  $this->uri = $this
    ->getImagePath();
  $item = $this->dummyItem;
  if (isset($this->testItems[0])) {
    $item = $this->testItems[0];
    if ($item instanceof ImageItem) {
      $this->uri = ($entity = $item->entity) && empty($item->uri) ? $entity
        ->getFileUri() : $item->uri;
    }
  }
  $this->testItem = $item;
  $this->data = [
    'settings' => $this
      ->getFormatterSettings(),
    'item' => $item,
  ];
  $this->imageFactory = $this->container
    ->get('image.factory');
}