You are here

private function ModerationContext::getWorkflow in Lightning Workflow 8.2

Returns the workflow type plugin for the current node.

Return value

\Drupal\workflows\WorkflowTypeInterface The workflow type plugin.

File

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

Class

ModerationContext
Contains miscellaneous step definitions for testing moderation UIs.

Namespace

Acquia\LightningExtension\Context

Code

private function getWorkflow() {
  Assert::notEmpty($this->node);

  /** @var \Drupal\workflows\WorkflowInterface $workflow */
  $workflow = \Drupal::service('content_moderation.moderation_information')
    ->getWorkflowForEntity($this->node);
  Assert::notEmpty($workflow);
  return $workflow
    ->getTypePlugin();
}