You are here

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

Creates a moderation state.

Parameters

string $id: The state ID.

bool $published: Whether content in this state is published.

bool $default_revision: Whether content in this state is the default revision.

1 call to WorkflowCollectorTest::createState()
WorkflowCollectorTest::setUp in tests/src/Kernel/WorkflowCollectorTest.php

File

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

Class

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

Namespace

Drupal\Tests\wbm2cm\Kernel

Code

protected function createState($id, $published, $default_revision) {
  ModerationState::create([
    'id' => $id,
    'label' => $this
      ->randomMachineName(),
    'published' => $published,
    'default_revision' => $default_revision,
  ])
    ->save();
}