You are here

protected function CommentResourceTestBase::getNormalizedPatchEntity in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php \Drupal\Tests\comment\Functional\Rest\CommentResourceTestBase::getNormalizedPatchEntity()
  2. 10 core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php \Drupal\Tests\comment\Functional\Rest\CommentResourceTestBase::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

Overrides EntityResourceTestBase::getNormalizedPatchEntity

See also

::testPatch

File

core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php, line 257

Class

CommentResourceTestBase

Namespace

Drupal\Tests\comment\Functional\Rest

Code

protected function getNormalizedPatchEntity() {
  return array_diff_key($this
    ->getNormalizedPostEntity(), [
    'entity_type' => TRUE,
    'entity_id' => TRUE,
    'field_name' => TRUE,
  ]);
}