/**
* Tests the revisions tracked by a workspace.
*
* @covers ::getTrackedEntities
* @covers ::getAssociatedRevisions
*/
public function testWorkspaceAssociation() { $this->
createNode(['title' => 'Test article 1 - live - unpublished', 'type' => 'article', 'status' => 0
]);
$this->
createNode(['title' => 'Test article 2 - live - published', 'type' => 'article'
]);
// Edit one of the existing nodes in 'stage'.
$this->
switchToWorkspace('stage'
);
$node =
$this->entityTypeManager->
getStorage('node'
)->
load(1
);
$node->
setTitle('Test article 1 - stage - published'
);
$node->
setPublished();
// This creates rev. 3.
$node->
save();
// Generate content with the following structure:
// Stage:
// - Test article 3 - stage - unpublished (rev. 4)
// - Test article 4 - stage - published (rev. 5 and 6)
$this->
createNode(['title' => 'Test article 3 - stage - unpublished', 'type' => 'article', 'status' => 0
]);