function ResourceTestBase::entityLoadUnchanged

Same name in other branches
  1. 9 core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\jsonapi\Functional\ResourceTestBase::entityLoadUnchanged()
  2. 8.9.x core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\jsonapi\Functional\ResourceTestBase::entityLoadUnchanged()
  3. 10 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.

4 calls to ResourceTestBase::entityLoadUnchanged()
ResourceTestBase::doTestPatchIndividual in core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php
Tests PATCHing an individual resource, plus edge cases to ensure good DX.
ResourceTestBase::doTestPostIndividual in core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php
Tests POSTing an individual resource, plus edge cases to ensure good DX.
ResourceTestBase::resaveEntity in core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php
ResourceTestBase::testRevisions in core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php
Tests individual and collection revisions.

File

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

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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.