You are here

protected function EntityResourceTestBase::getNormalizedPatchEntity in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase::getNormalizedPatchEntity()
  2. 9 core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase::getNormalizedPatchEntity()

Returns the normalized PATCH entity.

By default, reuses ::getNormalizedPostEntity(), which works fine for most entity types. A counterexample: the 'comment' entity type.

Return value

array

See also

::testPatch

1 call to EntityResourceTestBase::getNormalizedPatchEntity()
EntityResourceTestBase::testPatch in core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php
Tests a PATCH request for an entity, plus edge cases to ensure good DX.
3 methods override EntityResourceTestBase::getNormalizedPatchEntity()
FileResourceTestBase::getNormalizedPatchEntity in core/modules/file/tests/src/Functional/Rest/FileResourceTestBase.php
Returns the normalized PATCH entity.
MediaResourceTestBase::getNormalizedPatchEntity in core/modules/media/tests/src/Functional/Rest/MediaResourceTestBase.php
Returns the normalized PATCH entity.
WorkspaceResourceTestBase::getNormalizedPatchEntity in core/modules/workspaces/tests/src/Functional/EntityResource/WorkspaceResourceTestBase.php
Returns the normalized PATCH entity.

File

core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php, line 292

Class

EntityResourceTestBase
Even though there is the generic EntityResource, it's necessary for every entity type to have its own test, because they each have different fields, validation constraints, et cetera. It's not because the generic case works, that every case…

Namespace

Drupal\Tests\rest\Functional\EntityResource

Code

protected function getNormalizedPatchEntity() {
  return $this
    ->getNormalizedPostEntity();
}