function FileResourceTestBase::doTestPost
Tests a POST request for an entity, plus edge cases to ensure good DX.
Overrides EntityResourceTestBase::doTestPost
File
-
core/
modules/ file/ tests/ src/ Functional/ Rest/ FileResourceTestBase.php, line 50
Class
- FileResourceTestBase
- Resource test base for file entity.
Namespace
Drupal\Tests\file\Functional\RestCode
protected function doTestPost() : void {
// Drupal does not allow creating file entities independently. It allows
// you to create file entities that are referenced from another entity
// (e.g. an image for a node's image field).
// For that purpose, there is the "file_upload" REST resource plugin.
// @see \Drupal\file\FileAccessControlHandler::checkCreateAccess()
// @see \Drupal\file\Plugin\rest\resource\FileUploadResource
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.