$this->
assertWorkspaceStatus($test_scenarios['add_unpublished_node_in_stage'
], 'node'
);
$this->
assertWorkspaceAssociation($expected_workspace_association['add_unpublished_node_in_stage'
], 'node'
);
// Add a new published node on 'stage'.
$this->
switchToWorkspace('stage'
);
$this->
createNode(['title' => 'stage - 4 - r6 - published', 'created' =>
$this->createdTimestamp++, 'status' => TRUE
]);
$this->
assertWorkspaceStatus($test_scenarios['add_published_node_in_stage'
], 'node'
);
$this->
assertWorkspaceAssociation($expected_workspace_association['add_published_node_in_stage'
], 'node'
);
// Publish 'stage' to 'live'.
/** @var \Drupal\workspaces\WorkspacePublisher $workspace_publisher */
$workspace_publisher = \Drupal::
service('workspaces.operation_factory'
)->
getPublisher($this->workspaces
['stage'
]);
// Check which revisions need to be pushed.
$expected =
[ 'node' =>
[ 3 => 1,
4 => 2,
5 => 3,
7 => 4,
],
];
$this->
assertEquals($expected,
$workspace_publisher->
getDifferringRevisionIdsOnSource());