You are here

protected function BlazyCreationTestTrait::getImagePath in Blazy 8

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

Returns path to the stored image location.

2 calls to BlazyCreationTestTrait::getImagePath()
BlazyCreationTestTrait::setUpRealImage in tests/src/Traits/BlazyCreationTestTrait.php
Set up dummy image.
BlazyJavaScriptTest::testFormatterDisplay in tests/src/FunctionalJavascript/BlazyJavaScriptTest.php
Test the Blazy element from loading to loaded states.

File

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

Class

BlazyCreationTestTrait
A Trait common for Blazy tests.

Namespace

Drupal\Tests\blazy\Traits

Code

protected function getImagePath($is_dir = FALSE) {
  $path = $this->root . '/sites/default/files/simpletest/' . $this->testPluginId;
  $item = $this
    ->createDummyImage();
  $uri = ($entity = $item->entity) && empty($item->uri) ? $entity
    ->getFileUri() : $item->uri;
  $this->dummyUri = $uri;
  $this->dummyItem = $item;
  $this->dummyData = [
    'settings' => $this
      ->getFormatterSettings(),
    'item' => $item,
  ];
  return $is_dir ? $path : $uri;
}