You are here

public function CreateTest::assertCreateEntityNoData in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/rest/src/Tests/CreateTest.php \Drupal\rest\Tests\CreateTest::assertCreateEntityNoData()

Try to send no data at all, which does not make sense on POST requests.

Parameters

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

4 calls to CreateTest::assertCreateEntityNoData()
CreateTest::testCreateComment in core/modules/rest/src/Tests/CreateTest.php
Test comment creation.
CreateTest::testCreateEntityTest in core/modules/rest/src/Tests/CreateTest.php
Tests valid and invalid create requests for 'entity_test' entity type.
CreateTest::testCreateNode in core/modules/rest/src/Tests/CreateTest.php
Tests several valid and invalid create requests for 'node' entity type.
CreateTest::testCreateUser in core/modules/rest/src/Tests/CreateTest.php
Tests several valid and invalid create requests for 'user' entity type.

File

core/modules/rest/src/Tests/CreateTest.php, line 418
Contains \Drupal\rest\Tests\CreateTest.

Class

CreateTest
Tests the creation of resources.

Namespace

Drupal\rest\Tests

Code

public function assertCreateEntityNoData($entity_type) {
  $this
    ->httpRequest('entity/' . $entity_type, 'POST', NULL, $this->defaultMimeType);
  $this
    ->assertResponse(400);
}