You are here

private function ModerationContext::getStateId in Lightning Workflow 8.2

Returns the workflow state ID matching a label.

Parameters

string $state_label: The state label.

Return value

string The state ID.

1 call to ModerationContext::getStateId()
ModerationContext::assertInPlaceStateTransition in tests/contexts/ModerationContext.behat.inc
Asserts that the moderation sidebar works.

File

tests/contexts/ModerationContext.behat.inc, line 78

Class

ModerationContext
Contains miscellaneous step definitions for testing moderation UIs.

Namespace

Acquia\LightningExtension\Context

Code

private function getStateId($state_label) {
  $states = array_filter($this
    ->getWorkflow()
    ->getStates(), function (StateInterface $state) use ($state_label) {
    return $state
      ->label() === $state_label;
  });
  Assert::count($states, 1);
  return reset($states)
    ->id();
}