You are here

protected function WorkflowCollectorTest::setUp in Workbench Moderation to Content Moderation 8.2

Overrides KernelTestBase::setUp

File

tests/src/Kernel/WorkflowCollectorTest.php, line 45

Class

WorkflowCollectorTest
@covers \Drupal\wbm2cm\WorkflowCollector @group wbm2cm

Namespace

Drupal\Tests\wbm2cm\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installConfig('node');
  $this
    ->createState('archived', FALSE, TRUE);
  $this
    ->createState('draft', FALSE, FALSE);
  $this
    ->createState('review', FALSE, FALSE);
  $this
    ->createState('legal_review', FALSE, FALSE);
  $this
    ->createState('postponed', FALSE, FALSE);
  $this
    ->createState('published', TRUE, TRUE);
  $states = [
    'archived',
    'draft',
    'review',
    'published',
  ];
  $this
    ->createContentType('page', $states);
  $this
    ->createContentType('article', $states);
  $states = [
    'archived',
    'draft',
    'review',
    'legal_review',
    'postponed',
    'published',
  ];
  $this
    ->createContentType('press_release', $states);
  $states = [
    'archived',
    'draft',
    'review',
    'legal_review',
    'published',
  ];
  $this
    ->createContentType('announcement', $states);
  $this
    ->createContentType('offering', $states);
  $this
    ->createTransition('archived', 'draft');
  $this
    ->createTransition('draft', 'draft');
  $this
    ->createTransition('draft', 'review');
  $this
    ->createTransition('review', 'draft');
  $this
    ->createTransition('review', 'legal_review');
  $this
    ->createTransition('legal_review', 'draft');
  $this
    ->createTransition('review', 'published');
  $this
    ->createTransition('legal_review', 'published');
  $this
    ->createTransition('published', 'archived');
  $this
    ->createTransition('published', 'draft');
  module_load_install('wbm2cm');
  wbm2cm_install();
}