function WorkspaceTest::getPatchDocument
Same name and namespace in other branches
- 11.x core/modules/jsonapi/tests/src/Functional/WorkspaceTest.php \Drupal\Tests\jsonapi\Functional\WorkspaceTest::getPatchDocument()
Returns the JSON:API PATCH document.
By default, reuses ::getPostDocument(), which works fine for most entity types. A counter example: the 'comment' entity type.
Return value
array A JSON:API request document.
Overrides ResourceTestBase::getPatchDocument
File
-
core/
modules/ jsonapi/ tests/ src/ Functional/ WorkspaceTest.php, line 212
Class
- WorkspaceTest
- JSON:API integration test for the "Workspace" content entity type.
Namespace
Drupal\Tests\jsonapi\FunctionalCode
protected function getPatchDocument() : array {
$patch_document = parent::getPatchDocument();
unset($patch_document['data']['attributes']['drupal_internal__id']);
return $patch_document;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.