You are here

public function GalleryBundleTest::loadMediaItem in D7 Media 8

Loads the media entity item.

Parameters

int $id: The id of the item.

Return value

\Drupal\media_entity\MediaInterface The media entity item.

1 call to GalleryBundleTest::loadMediaItem()
GalleryBundleTest::testGalleryItemThumbnail in src/Tests/GalleryBundleTest.php
Tests thumbnail of the gallery item.

File

src/Tests/GalleryBundleTest.php, line 178

Class

GalleryBundleTest
Ensures that media bundle for gallery can be created.

Namespace

Drupal\media\Tests

Code

public function loadMediaItem($id) {
  $item = $this->container
    ->get('entity_type.manager')
    ->getStorage('media')
    ->loadUnchanged($id);
  return $item;
}