function ResourceTestBase::entityLoadUnchanged

Same name in other branches
  1. 8.9.x core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\jsonapi\Functional\ResourceTestBase::entityLoadUnchanged()
  2. 10 core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php \Drupal\Tests\jsonapi\Functional\ResourceTestBase::entityLoadUnchanged()
  3. 11.x 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::setUpFields in core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php
Sets up additional fields for testing.
ResourceTestBase::testPatchIndividual in core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php
Tests PATCHing an individual resource, plus edge cases to ensure good DX.
ResourceTestBase::testPostIndividual in core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php
Tests POSTing an individual resource, plus edge cases to ensure good DX.
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 3491

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.