function MediaThumbnailFormatterTest::setUp

Same name in other branches
  1. 9 core/modules/media/tests/src/Kernel/MediaThumbnailFormatterTest.php \Drupal\Tests\media\Kernel\MediaThumbnailFormatterTest::setUp()
  2. 11.x core/modules/media/tests/src/Kernel/MediaThumbnailFormatterTest.php \Drupal\Tests\media\Kernel\MediaThumbnailFormatterTest::setUp()

Overrides MediaKernelTestBase::setUp

File

core/modules/media/tests/src/Kernel/MediaThumbnailFormatterTest.php, line 49

Class

MediaThumbnailFormatterTest
@coversDefaultClass \Drupal\media\Plugin\Field\FieldFormatter\MediaThumbnailFormatter @group media

Namespace

Drupal\Tests\media\Kernel

Code

protected function setUp() : void {
    parent::setUp();
    // Create an entity bundle that has a media reference field.
    $entity_test_bundle = EntityTestBundle::create([
        'id' => $this->testEntityBundleId,
    ]);
    $entity_test_bundle->save();
    $this->createEntityReferenceField($this->testEntityTypeId, $this->testEntityBundleId, $this->mediaFieldName, $this->mediaFieldName, 'media');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.