function CommentResourceTestBase::getNormalizedPostEntity

Same name and namespace in other branches
  1. 11.x core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php \Drupal\Tests\comment\Functional\Rest\CommentResourceTestBase::getNormalizedPostEntity()
  2. 10 core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php \Drupal\Tests\comment\Functional\Rest\CommentResourceTestBase::getNormalizedPostEntity()
  3. 8.9.x core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php \Drupal\Tests\comment\Functional\Rest\CommentResourceTestBase::getNormalizedPostEntity()

File

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

Class

CommentResourceTestBase

Namespace

Drupal\Tests\comment\Functional\Rest

Code

protected function getNormalizedPostEntity() {
  return [
    'comment_type' => [
      [
        'target_id' => 'comment',
      ],
    ],
    'entity_type' => [
      [
        'value' => 'entity_test',
      ],
    ],
    'entity_id' => [
      [
        'target_id' => (int) EntityTest::load(1)->id(),
      ],
    ],
    'field_name' => [
      [
        'value' => 'comment',
      ],
    ],
    'subject' => [
      [
        'value' => 'Dramallama',
      ],
    ],
    'comment_body' => [
      [
        'value' => 'Llamas are awesome.',
        'format' => 'plain_text',
      ],
    ],
  ];
}

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