protected function WorkspaceTestUtilities::createWorkspaceThroughUi in Drupal 8
Same name and namespace in other branches
- 9 core/modules/workspaces/tests/src/Functional/WorkspaceTestUtilities.php \Drupal\Tests\workspaces\Functional\WorkspaceTestUtilities::createWorkspaceThroughUi()
 - 10 core/modules/workspaces/tests/src/Functional/WorkspaceTestUtilities.php \Drupal\Tests\workspaces\Functional\WorkspaceTestUtilities::createWorkspaceThroughUi()
 
Creates a new Workspace through the UI.
Parameters
string $label: The label of the workspace to create.
string $id: The ID of the workspace to create.
string $parent: (optional) The ID of the parent workspace. Defaults to '_none'.
Return value
\Drupal\workspaces\WorkspaceInterface The workspace that was just created.
11 calls to WorkspaceTestUtilities::createWorkspaceThroughUi()
- WorkspaceBypassTest::testBypassOwnWorkspace in core/
modules/ workspaces/ tests/ src/ Functional/ WorkspaceBypassTest.php  - Verifies that a user can edit anything in a workspace they own.
 - WorkspaceConcurrentEditingTest::testConcurrentEditing in core/
modules/ workspaces/ tests/ src/ Functional/ WorkspaceConcurrentEditingTest.php  - Test editing a node in multiple workspaces.
 - WorkspacePermissionsTest::testCreateWorkspace in core/
modules/ workspaces/ tests/ src/ Functional/ WorkspacePermissionsTest.php  - Verifies that a user can create but not edit a workspace.
 - WorkspacePermissionsTest::testDeleteAnyWorkspace in core/
modules/ workspaces/ tests/ src/ Functional/ WorkspacePermissionsTest.php  - Verifies that a user can delete any workspace.
 - WorkspacePermissionsTest::testDeleteOwnWorkspace in core/
modules/ workspaces/ tests/ src/ Functional/ WorkspacePermissionsTest.php  - Verifies that a user can create and delete only their own workspace.
 
File
- core/
modules/ workspaces/ tests/ src/ Functional/ WorkspaceTestUtilities.php, line 58  
Class
- WorkspaceTestUtilities
 - Utility methods for use in BrowserTestBase tests.
 
Namespace
Drupal\Tests\workspaces\FunctionalCode
protected function createWorkspaceThroughUi($label, $id, $parent = '_none') {
  $this
    ->drupalPostForm('/admin/config/workflow/workspaces/add', [
    'id' => $id,
    'label' => $label,
    'parent' => $parent,
  ], 'Save');
  $this
    ->getSession()
    ->getPage()
    ->hasContent("{$label} ({$id})");
  return Workspace::load($id);
}