/**
* Tests a workflow with a default moderation state set.
*/
public function testPublishedDefaultState() { // Set the default moderation state to be "published".
$this->
drupalGet('admin/config/workflow/workflows/manage/' .
$this->workflow->
id());
$this->
submitForm(['type_settings[workflow_settings][default_moderation_state]' => 'published'
], 'Save'
);
$this->
drupalGet('node/add/moderated_content'
);
$this->
assertEquals('published',
$this->
assertSession()->
selectExists('moderation_state[0][state]'
)->
getValue());
$this->
submitForm([ 'title[0][value]' => 'moderated content',
], 'Save'
);
$node =
$this->
getNodeByTitle('moderated content'
);
$this->
assertEquals('published',
$node->moderation_state->value
);
} /**
* Tests access to deleting the default state.
*/