You are here

protected function MediaEntityFileReplaceTest::loadFileEntity in Media Entity File Replace 8

Load a single file entity by ID, ignoring object cache.

1 call to MediaEntityFileReplaceTest::loadFileEntity()
MediaEntityFileReplaceTest::testModule in tests/src/Functional/MediaEntityFileReplaceTest.php
Tests basic functionality of the module.

File

tests/src/Functional/MediaEntityFileReplaceTest.php, line 223

Class

MediaEntityFileReplaceTest
Class MediaEntityFileReplaceTest.

Namespace

Drupal\Tests\media_entity_file_replace\Functional

Code

protected function loadFileEntity($id) {
  $fileStorage = \Drupal::entityTypeManager()
    ->getStorage('file');
  $fileStorage
    ->resetCache();
  $file = $fileStorage
    ->load($id);
  $this
    ->assertNotNull($file, "No file entity with id {$id} was found.");
  return $file;
}