You are here

protected function ThunderTestTrait::loadMediaByUuid in Thunder 6.1.x

Same name and namespace in other branches
  1. 6.2.x tests/src/Traits/ThunderTestTrait.php \Drupal\Tests\thunder\Traits\ThunderTestTrait::loadMediaByUuid()

Load media by UUID.

Parameters

string $uuid: The uuid.

Return value

\Drupal\media\MediaInterface|false|null The media entity.

Throws

\Drupal\Core\Entity\EntityStorageException

9 calls to ThunderTestTrait::loadMediaByUuid()
ArticleCreationTest::testCreateArticle in tests/src/FunctionalJavascript/ArticleCreationTest.php
Test Creation of Article.
ChannelsTagsTest::testChannelsCreation in tests/src/FunctionalJavascript/ChannelsTagsTest.php
Test channel creation, tagging of articles and channel page with articles.
LiveblogTest::testWithPusher in tests/src/FunctionalJavascript/Integration/LiveblogTest.php
Testing of module integration.
MediaGalleryModifyTest::testAddRemove in tests/src/FunctionalJavascript/MediaGalleryModifyTest.php
Test add/remove Images in Gallery.
MediaGalleryModifyTest::testOrderChange in tests/src/FunctionalJavascript/MediaGalleryModifyTest.php
Test order change for Gallery.

... See full list

File

tests/src/Traits/ThunderTestTrait.php, line 183

Class

ThunderTestTrait
Use this trait to reuse an existing database.

Namespace

Drupal\Tests\thunder\Traits

Code

protected function loadMediaByUuid($uuid) {
  return \Drupal::getContainer()
    ->get('entity.repository')
    ->loadEntityByUuid('media', $uuid);
}