$workspace_1_node_2->
setNewRevision(TRUE
);
$workspace_1_node_2->
save();
} // The workspace should now track 2 nodes.
$tracked_entities =
$workspace_association->
getTrackedEntities($workspace_1->
id());
$this->
assertCount(2,
$tracked_entities['node'
]);
// Since all the revisions were created inside a workspace, including the
// default one, 'workspace_1' should be tracking all 10 revisions.
$associated_revisions =
$workspace_association->
getAssociatedRevisions($workspace_1->
id(), 'node'
);
$this->
assertCount(10,
$associated_revisions);
// Check that we are allowed to delete the workspace.
$this->
assertTrue($workspace_1->
access('delete',
$admin));
// Delete the workspace and check that all the workspace_association
// entities and all the node revisions have been deleted as well.
$workspace_1->
delete();
// There are no more tracked entities in 'workspace_1'.
$tracked_entities =
$workspace_association->
getTrackedEntities($workspace_1->
id());