function WorkspaceResourceTestBase::createAnotherEntity

Same name in this branch
  1. 10 core/modules/workspaces/tests/src/Functional/EntityResource/WorkspaceResourceTestBase.php \Drupal\Tests\workspaces\Functional\EntityResource\WorkspaceResourceTestBase::createAnotherEntity()
Same name in other branches
  1. 9 core/modules/workspaces/tests/src/Functional/EntityResource/WorkspaceResourceTestBase.php \Drupal\Tests\workspaces\Functional\EntityResource\WorkspaceResourceTestBase::createAnotherEntity()
  2. 8.9.x core/modules/workspaces/tests/src/Functional/EntityResource/WorkspaceResourceTestBase.php \Drupal\Tests\workspaces\Functional\EntityResource\WorkspaceResourceTestBase::createAnotherEntity()
  3. 11.x core/modules/workspaces/tests/src/Functional/EntityResource/WorkspaceResourceTestBase.php \Drupal\Tests\workspaces\Functional\EntityResource\WorkspaceResourceTestBase::createAnotherEntity()
  4. 11.x core/modules/workspaces/tests/src/Functional/Rest/WorkspaceResourceTestBase.php \Drupal\Tests\workspaces\Functional\Rest\WorkspaceResourceTestBase::createAnotherEntity()

Overrides EntityResourceTestBase::createAnotherEntity

File

core/modules/workspaces/tests/src/Functional/Rest/WorkspaceResourceTestBase.php, line 88

Class

WorkspaceResourceTestBase
Base class for workspace EntityResource tests.

Namespace

Drupal\Tests\workspaces\Functional\Rest

Code

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

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