You are here

public function SlickFormatterTest::testGetThumbnail in Slick Carousel 8.2

Same name and namespace in other branches
  1. 8 tests/src/Kernel/SlickFormatterTest.php \Drupal\Tests\slick\Kernel\SlickFormatterTest::testGetThumbnail()

Tests for \Drupal\slick\SlickFormatter::testGetThumbnail().

@covers \Drupal\slick\SlickFormatter::getThumbnail @dataProvider providerTestGetThumbnail

Parameters

string $uri: The uri being tested.

bool $expected: The expected output.

File

tests/src/Kernel/SlickFormatterTest.php, line 130

Class

SlickFormatterTest
Tests the Slick field rendering using the image field type.

Namespace

Drupal\Tests\slick\Kernel

Code

public function testGetThumbnail($uri, $expected) {
  $settings = $this
    ->getFormatterSettings() + SlickDefault::extendedSettings();
  $settings['uri'] = empty($uri) ? '' : $this->uri;
  $thumbnail = $this->slickFormatter
    ->getThumbnail($settings, $this->testItem);
  $this
    ->assertEquals($expected, !empty($thumbnail));
}