You are here

protected function EntityResourceTestBase::getSecondNormalizedPostEntity in Drupal 8

Gets the second normalized POST entity.

Entity types can have non-sequential IDs, and in that case the second entity created for POST testing needs to be able to specify a different ID.

Return value

array An array structure as returned by ::getNormalizedPostEntity().

See also

::testPost

::getNormalizedPostEntity

1 call to EntityResourceTestBase::getSecondNormalizedPostEntity()
EntityResourceTestBase::testPost in core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php
Tests a POST request for an entity, plus edge cases to ensure good DX.
1 method overrides EntityResourceTestBase::getSecondNormalizedPostEntity()
WorkspaceResourceTestBase::getSecondNormalizedPostEntity in core/modules/workspaces/tests/src/Functional/EntityResource/WorkspaceResourceTestBase.php
Gets the second normalized POST entity.

File

core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php, line 313

Class

EntityResourceTestBase
Even though there is the generic EntityResource, it's necessary for every entity type to have its own test, because they each have different fields, validation constraints, et cetera. It's not because the generic case works, that every case…

Namespace

Drupal\Tests\rest\Functional\EntityResource

Code

protected function getSecondNormalizedPostEntity() {

  // Return the values of the "parent" method by default.
  return $this
    ->getNormalizedPostEntity();
}