protected function RESTTestBase::entityCreate

Creates entity objects based on their types.

Parameters

string $entity_type: The type of the entity that should be created.

Return value

\Drupal\Core\Entity\EntityInterface The new entity object.

3 calls to RESTTestBase::entityCreate()
DeleteTest::testDelete in drupal/core/modules/rest/lib/Drupal/rest/Tests/DeleteTest.php
Tests several valid and invalid delete requests on all entity types.
ReadTest::testRead in drupal/core/modules/rest/lib/Drupal/rest/Tests/ReadTest.php
Tests several valid and invalid read requests on all entity types.
UpdateTest::testPatchUpdate in drupal/core/modules/rest/lib/Drupal/rest/Tests/UpdateTest.php
Tests several valid and invalid partial update requests on test entities.

File

drupal/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php, line 143
Definition of Drupal\rest\test\RESTTestBase.

Class

RESTTestBase
Test helper class that provides a REST client method to send HTTP requests.

Namespace

Drupal\rest\Tests

Code

protected function entityCreate($entity_type) {
  return entity_create($entity_type, $this
    ->entityValues($entity_type));
}