// node_access_test_node_access_records().
\Drupal::
state()->
set('node_access_test.private', TRUE
);
$this->
drupalLogin($this->adminUser
);
// Access the node form before moderation is enabled, the publication state
// should now be visible.
$this->
drupalGet('node/add/moderated_content'
);
$this->
assertSession()->
fieldExists('Published'
);
// Now enable the workflow.
$this->
enableModerationThroughUi('moderated_content', 'editorial'
);
// Access that the status field is no longer visible.
$this->
drupalGet('node/add/moderated_content'
);
$this->
assertSession()->
fieldNotExists('Published'
);
// Create a node to test with.
$this->
submitForm([ 'title[0][value]' => 'moderated content',
'moderation_state[0][state]' => 'draft',
], 'Save'
);
$node =
$this->
getNodeByTitle('moderated content'
);