You are here

protected function FileUrlFieldItemListTest::reloadEntity in File URL 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Kernel/FileUrlFieldItemListTest.php \Drupal\Tests\file_url\Kernel\FileUrlFieldItemListTest::reloadEntity()

Reloads the given entity from the storage and returns it.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity to be reloaded.

Return value

\Drupal\Core\Entity\EntityInterface The reloaded entity.

1 call to FileUrlFieldItemListTest::reloadEntity()
FileUrlFieldItemListTest::testReferencedEntities in tests/src/Kernel/FileUrlFieldItemListTest.php
Tests the retrieval of referenced files.

File

tests/src/Kernel/FileUrlFieldItemListTest.php, line 152

Class

FileUrlFieldItemListTest
Tests the overridden field item list.

Namespace

Drupal\Tests\file_url\Kernel

Code

protected function reloadEntity(EntityInterface $entity) {
  $controller = $this->entityTypeManager
    ->getStorage($entity
    ->getEntityTypeId());
  $controller
    ->resetCache([
    $entity
      ->id(),
  ]);
  return $controller
    ->load($entity
    ->id());
}