function WorkspaceTest::createEntity

Same name and namespace in other branches
  1. 11.x core/modules/jsonapi/tests/src/Functional/WorkspaceTest.php \Drupal\Tests\jsonapi\Functional\WorkspaceTest::createEntity()

Creates the entity to be tested.

Return value

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

Overrides ResourceTestBase::createEntity

File

core/modules/jsonapi/tests/src/Functional/WorkspaceTest.php, line 101

Class

WorkspaceTest
JSON:API integration test for the "Workspace" content entity type.

Namespace

Drupal\Tests\jsonapi\Functional

Code

protected function createEntity() : EntityInterface {
  $entity = Workspace::create([
    'id' => 'campaign',
    'label' => 'Campaign',
    'uid' => $this->account
      ->id(),
    'created' => 123456789,
  ]);
  $entity->save();
  return $entity;
}

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