You are here

protected function BlazyUnitTestTrait::doPreRenderImage in Blazy 8

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

Pre render Blazy image.

Parameters

array $build: The data containing: settings and image item.

Return value

array The pre_render element.

2 calls to BlazyUnitTestTrait::doPreRenderImage()
BlazyManagerTest::testPreRenderImage in tests/src/Kernel/BlazyManagerTest.php
Tests BlazyManager image.
BlazyUnitTest::testPreRenderImageLightbox in tests/src/Unit/BlazyUnitTest.php
Tests BlazyManager image with lightbox support.

File

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

Class

BlazyUnitTestTrait
A Trait common for Blazy Unit tests.

Namespace

Drupal\Tests\blazy\Traits

Code

protected function doPreRenderImage(array $build = []) {
  $image = $this->blazyManager
    ->getImage($build);
  $image['#build']['settings'] = array_merge($this
    ->getCacheMetaData(), $build['settings']);
  $image['#build']['item'] = $build['item'];
  return $this->blazyManager
    ->preRenderImage($image);
}