function FileUploadResourceTestBase::getNormalizedPostEntity

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

Returns the normalized POST entity referencing the uploaded file.

Return value

array

See also

::testPostFileUpload()

\Drupal\Tests\rest\Functional\EntityResource\EntityTest\EntityTestResourceTestBase::getNormalizedPostEntity()

1 call to FileUploadResourceTestBase::getNormalizedPostEntity()
FileUploadResourceTestBase::testPostFileUpload in core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php
Tests using the file upload POST route.

File

core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php, line 236

Class

FileUploadResourceTestBase
Tests binary data file upload route.

Namespace

Drupal\Tests\rest\Functional

Code

protected function getNormalizedPostEntity() {
    return [
        'type' => [
            [
                'value' => 'entity_test',
            ],
        ],
        'name' => [
            [
                'value' => 'Drama llama',
            ],
        ],
        'field_rest_file_test' => [
            [
                'target_id' => 1,
                'description' => 'The most fascinating file ever!',
            ],
        ],
    ];
}

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