You are here

public function FileResourceTestBase::testPost in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/file/tests/src/Functional/Rest/FileResourceTestBase.php \Drupal\Tests\file\Functional\Rest\FileResourceTestBase::testPost()
  2. 9 core/modules/file/tests/src/Functional/Rest/FileResourceTestBase.php \Drupal\Tests\file\Functional\Rest\FileResourceTestBase::testPost()

Tests a POST request for an entity, plus edge cases to ensure good DX.

Overrides EntityResourceTestBase::testPost

File

core/modules/file/tests/src/Functional/Rest/FileResourceTestBase.php, line 197

Class

FileResourceTestBase

Namespace

Drupal\Tests\file\Functional\Rest

Code

public function testPost() {

  // 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
  $this
    ->markTestSkipped();
}