You are here

public function CommentTest::testPatchIndividual in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/jsonapi/tests/src/Functional/CommentTest.php \Drupal\Tests\jsonapi\Functional\CommentTest::testPatchIndividual()

Tests PATCHing an individual resource, plus edge cases to ensure good DX.

Overrides ResourceTestBase::testPatchIndividual

File

core/modules/jsonapi/tests/src/Functional/CommentTest.php, line 454

Class

CommentTest
JSON:API integration test for the "Comment" content entity type.

Namespace

Drupal\Tests\jsonapi\Functional

Code

public function testPatchIndividual() {

  // Ensure ::getModifiedEntityForPatchTesting() can pick an alternative value
  // for the 'entity_id' field.
  EntityTest::create([
    'name' => $this
      ->randomString(),
    'type' => 'bar',
  ])
    ->save();
  return parent::testPatchIndividual();
}