3 namespace Drupal\Tests\content_moderation\Traits;
5 use Drupal\workflows\Entity\Workflow;
8 * Trait ContentModerationTestTraint.
10 trait ContentModerationTestTrait {
13 * Creates the editorial workflow.
15 * @return \Drupal\workflows\Entity\Workflow
16 * The editorial workflow entity.
18 protected function createEditorialWorkflow() {
19 $workflow = Workflow::create([
20 'type' => 'content_moderation',
22 'label' => 'Editorial',
26 'label' => 'Archived',
29 'default_revision' => TRUE,
34 'default_revision' => FALSE,
38 'label' => 'Published',
40 'default_revision' => TRUE,
47 'from' => ['published'],
52 'label' => 'Restore to Draft',
53 'from' => ['archived'],
57 'archived_published' => [
59 'from' => ['archived'],
63 'create_new_draft' => [
64 'label' => 'Create New Draft',