You are here

protected function LingotekContentModerationTest::addReviewStateToEditorialWorkflow in Lingotek Translation 3.5.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/LingotekContentModerationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentModerationTest::addReviewStateToEditorialWorkflow()
  2. 4.0.x tests/src/Functional/LingotekContentModerationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentModerationTest::addReviewStateToEditorialWorkflow()
  3. 3.0.x tests/src/Functional/LingotekContentModerationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentModerationTest::addReviewStateToEditorialWorkflow()
  4. 3.1.x tests/src/Functional/LingotekContentModerationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentModerationTest::addReviewStateToEditorialWorkflow()
  5. 3.2.x tests/src/Functional/LingotekContentModerationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentModerationTest::addReviewStateToEditorialWorkflow()
  6. 3.3.x tests/src/Functional/LingotekContentModerationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentModerationTest::addReviewStateToEditorialWorkflow()
  7. 3.4.x tests/src/Functional/LingotekContentModerationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentModerationTest::addReviewStateToEditorialWorkflow()
  8. 3.6.x tests/src/Functional/LingotekContentModerationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentModerationTest::addReviewStateToEditorialWorkflow()
  9. 3.7.x tests/src/Functional/LingotekContentModerationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentModerationTest::addReviewStateToEditorialWorkflow()
  10. 3.8.x tests/src/Functional/LingotekContentModerationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentModerationTest::addReviewStateToEditorialWorkflow()

Adds a review state to the editorial workflow.

1 call to LingotekContentModerationTest::addReviewStateToEditorialWorkflow()
LingotekContentModerationTest::setUp in tests/src/Functional/LingotekContentModerationTest.php

File

tests/src/Functional/LingotekContentModerationTest.php, line 491

Class

LingotekContentModerationTest
Tests setting up the integration with content moderation.

Namespace

Drupal\Tests\lingotek\Functional

Code

protected function addReviewStateToEditorialWorkflow() {

  // Add a "Needs review" state to the editorial workflow.
  $workflow = Workflow::load('editorial');
  $definition = $workflow
    ->getTypePlugin();
  $definition
    ->addState('needs_review', 'Needs Review');
  $definition
    ->addTransition('request_review', 'Request Review', [
    'draft',
  ], 'needs_review');
  $definition
    ->addTransition('publish_review', 'Publish Review', [
    'needs_review',
  ], 'published');
  $definition
    ->addTransition('back_to_draft', 'Back to Draft', [
    'needs_review',
  ], 'draft');
  $workflow
    ->save();
}