You are here

public function ThumbnailTest::testThumbnailGeneration in Media entity Twitter 8

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/ThumbnailTest.php \Drupal\Tests\media_entity_twitter\Kernel\ThumbnailTest::testThumbnailGeneration()

Tests that thumbnail is generated if enabled and local image not available.

File

tests/src/Kernel/ThumbnailTest.php, line 167

Class

ThumbnailTest
Tests SVG thumbnail generation from Twitter API responses.

Namespace

Drupal\Tests\media_entity_twitter\Kernel

Code

public function testThumbnailGeneration() {
  $configuration = $this->plugin
    ->getConfiguration();
  $configuration['generate_thumbnails'] = TRUE;
  $this->plugin
    ->setConfiguration($configuration);
  $uri = $this->plugin
    ->thumbnail($this->entity);
  $this
    ->assertFileExists($uri);
}