X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcontent_moderation%2Ftests%2Fsrc%2FTraits%2FContentModerationTestTrait.php;fp=web%2Fcore%2Fmodules%2Fcontent_moderation%2Ftests%2Fsrc%2FTraits%2FContentModerationTestTrait.php;h=4e9ecc32c3f07fb799939a10979ec4cacea3c75a;hp=0000000000000000000000000000000000000000;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/content_moderation/tests/src/Traits/ContentModerationTestTrait.php b/web/core/modules/content_moderation/tests/src/Traits/ContentModerationTestTrait.php new file mode 100644 index 000000000..4e9ecc32c --- /dev/null +++ b/web/core/modules/content_moderation/tests/src/Traits/ContentModerationTestTrait.php @@ -0,0 +1,88 @@ + 'content_moderation', + 'id' => 'editorial', + 'label' => 'Editorial', + 'type_settings' => [ + 'states' => [ + 'archived' => [ + 'label' => 'Archived', + 'weight' => 5, + 'published' => FALSE, + 'default_revision' => TRUE, + ], + 'draft' => [ + 'label' => 'Draft', + 'published' => FALSE, + 'default_revision' => FALSE, + 'weight' => -5, + ], + 'published' => [ + 'label' => 'Published', + 'published' => TRUE, + 'default_revision' => TRUE, + 'weight' => 0, + ], + ], + 'transitions' => [ + 'archive' => [ + 'label' => 'Archive', + 'from' => ['published'], + 'to' => 'archived', + 'weight' => 2, + ], + 'archived_draft' => [ + 'label' => 'Restore to Draft', + 'from' => ['archived'], + 'to' => 'draft', + 'weight' => 3, + ], + 'archived_published' => [ + 'label' => 'Restore', + 'from' => ['archived'], + 'to' => 'published', + 'weight' => 4, + ], + 'create_new_draft' => [ + 'label' => 'Create New Draft', + 'to' => 'draft', + 'weight' => 0, + 'from' => [ + 'draft', + 'published', + ], + ], + 'publish' => [ + 'label' => 'Publish', + 'to' => 'published', + 'weight' => 1, + 'from' => [ + 'draft', + 'published', + ], + ], + ], + ], + ]); + $workflow->save(); + return $workflow; + } + +}