You are here

protected function BlazyUnitTestTrait::setUpUnitImages in Blazy 8.2

Same name and namespace in other branches
  1. 8 tests/src/Traits/BlazyUnitTestTrait.php \Drupal\Tests\blazy\Traits\BlazyUnitTestTrait::setUpUnitImages()

Setup the unit images.

3 calls to BlazyUnitTestTrait::setUpUnitImages()
BlazyManagerUnitTest::setUp in tests/src/Unit/BlazyManagerUnitTest.php
BlazyMediaUnitTest::setUp in tests/src/Unit/BlazyMediaUnitTest.php
BlazyUnitTestTrait::setUpMockImage in tests/src/Traits/BlazyUnitTestTrait.php
Setup the unit images.

File

tests/src/Traits/BlazyUnitTestTrait.php, line 264

Class

BlazyUnitTestTrait
A Trait common for Blazy Unit tests.

Namespace

Drupal\Tests\blazy\Traits

Code

protected function setUpUnitImages() {
  $item = new \stdClass();
  $item->uri = 'public://example.jpg';
  $item->entity = NULL;
  $item->alt = $this
    ->randomMachineName();
  $item->title = $this
    ->randomMachineName();
  $settings = $this
    ->getFormatterSettings();
  $this->uri = $settings['uri'] = $item->uri;
  $this->data = [
    'settings' => $settings,
    'item' => $item,
  ];
  $this->testItem = $item;
}