public function testWorkflowChanges($view_id) { // First, apply the Editorial workflow to both of our content types.
$this->
drupalGet('admin/config/workflow/workflows/manage/editorial/type/node'
);
$this->
submitForm([ 'bundles[example_a]' => TRUE,
'bundles[example_b]' => TRUE,
], 'Save'
);
\Drupal::
service('entity_type.bundle.info'
)->
clearCachedBundles();
// Update the view and make the default filter not exposed anymore,
// otherwise all results will be shown when there are no more moderated
// bundles left.
$this->
drupalGet("admin/structure/views/nojs/handler/{
$view_id}/default/filter/moderation_state"
);
$this->
submitForm([], 'Hide filter'
);
$this->
drupalGet("admin/structure/views/view/{
$view_id}"
);
$this->
submitForm([], 'Save'
);
// Add a few nodes in various moderation states.
$this->
createNode(['type' => 'example_a', 'moderation_state' => 'published'
]);