function WorkspaceResourceTestBase::createEntity

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

Overrides EntityResourceTestBase::createEntity

File

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

Class

WorkspaceResourceTestBase
Base class for workspace EntityResource tests.

Namespace

Drupal\Tests\workspaces\Functional\EntityResource

Code

protected function createEntity() {
    $workspace = Workspace::create([
        'id' => 'layla',
        'label' => 'Layla',
    ]);
    $workspace->save();
    return $workspace;
}

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