You are here

protected function RESTTestBase::entityCreate in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/rest/src/Tests/RESTTestBase.php \Drupal\rest\Tests\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.

8 calls to RESTTestBase::entityCreate()
AuthTest::testRead in core/modules/rest/src/Tests/AuthTest.php
Tests reading from an authenticated resource.
DeleteTest::testDelete in core/modules/rest/src/Tests/DeleteTest.php
Tests several valid and invalid delete requests on all entity types.
NodeTest::testNodes in core/modules/rest/src/Tests/NodeTest.php
Performs various tests on nodes and their REST API.
PageCacheTest::testConfigChangePageCache in core/modules/rest/src/Tests/PageCacheTest.php
Tests that configuration changes also clear the page cache.
ReadTest::testRead in core/modules/rest/src/Tests/ReadTest.php
Tests several valid and invalid read requests on all entity types.

... See full list

File

core/modules/rest/src/Tests/RESTTestBase.php, line 185
Contains \Drupal\rest\Tests\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));
}