You are here

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

Creates a moderation state transition.

Parameters

string $from_state: The moderation state from which to transition.

string $to_state: The moderation state to which to transition.

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

File

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

Class

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

Namespace

Drupal\Tests\wbm2cm\Kernel

Code

protected function createTransition($from_state, $to_state) {
  ModerationStateTransition::create([
    'id' => "{$from_state}_{$to_state}",
    'label' => $this
      ->randomMachineName(),
    'stateFrom' => $from_state,
    'stateTo' => $to_state,
  ])
    ->save();
}