protected function WorkbenchTransitionEmailTest::setupModerationForNodeType in Workbench Email 8
Same name and namespace in other branches
- 2.x tests/src/Functional/WorkbenchTransitionEmailTest.php \Drupal\Tests\workbench_email\Functional\WorkbenchTransitionEmailTest::setupModerationForNodeType()
Enables moderation for a given node type.
Parameters
\Drupal\node\NodeTypeInterface $node_type: Node type to enable moderation for.
Overrides WorkbenchEmailTestBase::setupModerationForNodeType
File
- tests/
src/ Functional/ WorkbenchTransitionEmailTest.php, line 33
Class
- WorkbenchTransitionEmailTest
- Tests the view access control handler for moderation state entities.
Namespace
Drupal\Tests\workbench_email\FunctionalCode
protected function setupModerationForNodeType(NodeTypeInterface $node_type) {
$node_type
->setThirdPartySetting('workbench_moderation', 'enabled', TRUE);
$states = array_keys(ModerationState::loadMultiple());
$node_type
->setThirdPartySetting('workbench_moderation', 'allowed_moderation_states', $states);
$node_type
->setThirdPartySetting('workbench_moderation', 'default_moderation_state', 'draft');
$node_type
->save();
}