You are here

protected function WorkspaceResourceTestBase::createAnotherEntity in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/workspaces/tests/src/Functional/EntityResource/WorkspaceResourceTestBase.php \Drupal\Tests\workspaces\Functional\EntityResource\WorkspaceResourceTestBase::createAnotherEntity()

Creates another entity to be tested.

Return value

\Drupal\Core\Entity\EntityInterface Another entity based on $this->entity.

Overrides EntityResourceTestBase::createAnotherEntity

File

core/modules/workspaces/tests/src/Functional/EntityResource/WorkspaceResourceTestBase.php, line 82

Class

WorkspaceResourceTestBase
Base class for workspace EntityResource tests.

Namespace

Drupal\Tests\workspaces\Functional\EntityResource

Code

protected function createAnotherEntity() {
  $workspace = $this->entity
    ->createDuplicate();
  $workspace->id = 'layla_dupe';
  $workspace->label = 'Layla_dupe';
  $workspace
    ->save();
  return $workspace;
}