public function ModerationContext::addModerationToContentType in Lightning Workflow 8.2
Enables moderation for a content type.
@When I enable moderation for the :node_type content type
Parameters
string $node_type: The machine name of the content type.
File
- tests/
contexts/ ModerationContext.behat.inc, line 157
Class
- ModerationContext
- Contains miscellaneous step definitions for testing moderation UIs.
Namespace
Acquia\LightningExtension\ContextCode
public function addModerationToContentType($node_type) {
/** @var \Drupal\node\NodeTypeInterface $node_type */
$node_type = entity_load('node_type', $node_type);
$node_type
->setThirdPartySetting('lightning_workflow', 'workflow', 'editorial');
lightning_workflow_node_type_insert($node_type);
array_push($this->moderated, $node_type
->id());
}