You are here

protected function ResourceTestBase::entityLoadUnchanged in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\jsonapi\Functional\ResourceTestBase::entityLoadUnchanged()
  2. 9 core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\jsonapi\Functional\ResourceTestBase::entityLoadUnchanged()

Loads an entity in the test container, ignoring the static cache.

@todo Remove this after https://www.drupal.org/project/drupal/issues/3038706 lands.

Parameters

int $id: The entity ID.

Return value

\Drupal\Core\Entity\EntityInterface|null The loaded entity.

File

core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php, line 3489

Class

ResourceTestBase
Subclass this for every JSON:API resource type.

Namespace

Drupal\Tests\jsonapi\Functional

Code

protected function entityLoadUnchanged($id) {
  $this->entityStorage
    ->resetCache();
  return $this->entityStorage
    ->loadUnchanged($id);
}