You are here

protected function EntityResourceTestBase::getNormalizedPatchEntity in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase::getNormalizedPatchEntity()
  2. 10 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.
5 methods override EntityResourceTestBase::getNormalizedPatchEntity()
CommentResourceTestBase::getNormalizedPatchEntity in core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php
Returns the normalized PATCH entity.
EntityTestDatetimeTest::getNormalizedPatchEntity in core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDatetimeTest.php
Returns the normalized PATCH entity.
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 297

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