function EntityResourceTestBase::createEntity

Same name and namespace in other branches
  1. 11.x core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase::createEntity()
  2. 10 core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase::createEntity()
  3. 9 core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase::createEntity()

Creates the entity to be tested.

Return value

\Drupal\Core\Entity\EntityInterface The entity to be tested.

2 methods override EntityResourceTestBase::createEntity()
EntityTestLabelResourceTestBase::createEntity in core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestLabelResourceTestBase.php
Creates the entity to be tested.
EntityViewModeResourceTestBase::createEntity in core/tests/Drupal/FunctionalTests/Rest/EntityViewModeResourceTestBase.php
Creates the entity to be tested.

File

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

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

abstract protected function createEntity();

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.