// so we can test it with default content.
$this->
enableModules(['workspaces'
]);
$this->container = \Drupal::
getContainer();
$this->entityTypeManager = \Drupal::
entityTypeManager();
$this->workspaceManager = \Drupal::
service('workspaces.manager'
);
$this->
installEntitySchema('workspace'
);
$this->
installSchema('workspaces',
['workspace_association'
]);
// Install the entity schema for supported entity types to ensure that the
// 'workspace' revision metadata field gets created.
foreach (array_keys($this->workspaceManager->
getSupportedEntityTypes()) as $entity_type_id) { $this->
installEntitySchema($entity_type_id);
} // Create two workspaces by default, 'live' and 'stage'.
$this->workspaces
['live'
] = Workspace::
create(['id' => 'live', 'label' => 'Live'
]);
$this->workspaces
['live'
]->
save();
$this->workspaces
['stage'
] = Workspace::
create(['id' => 'stage', 'label' => 'Stage'
]);
$this->workspaces
['stage'
]->
save();
$permissions =
array_intersect([ 'administer nodes',