function CommentResourceTestBase::getNormalizedPostEntity

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

Overrides EntityResourceTestBase::getNormalizedPostEntity

3 calls to CommentResourceTestBase::getNormalizedPostEntity()
CommentResourceTestBase::getNormalizedPatchEntity in core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php
Returns the normalized PATCH entity.
CommentResourceTestBase::testPostDxWithoutCriticalBaseFields in core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php
Tests POSTing a comment without critical base fields.
CommentResourceTestBase::testPostSkipCommentApproval in core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php
Tests POSTing a comment with and without 'skip comment approval'.

File

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

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' => 'Drama llama',
            ],
        ],
        '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.