You are here

protected function LingotekContentModerationTest::enableModerationThroughUI in Lingotek Translation 8.2

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

Enable moderation for a specified content type, using the UI.

Parameters

string $content_type_id: Machine name.

2 calls to LingotekContentModerationTest::enableModerationThroughUI()
LingotekContentModerationTest::setUp in tests/src/Functional/LingotekContentModerationTest.php
LingotekContentModerationTest::testDownloadWhenContentModerationWasSetupAfterLingotek in tests/src/Functional/LingotekContentModerationTest.php

File

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

Class

LingotekContentModerationTest
Tests setting up the integration with content moderation.

Namespace

Drupal\Tests\lingotek\Functional

Code

protected function enableModerationThroughUI($content_type_id) {
  if (floatval(\Drupal::VERSION) >= 8.4) {
    $this
      ->drupalGet('/admin/config/workflow/workflows/manage/editorial/type/node');
    $this
      ->assertFieldByName("bundles[{$content_type_id}]");
    $edit["bundles[{$content_type_id}]"] = TRUE;
    $this
      ->drupalPostForm(NULL, $edit, t('Save'));
  }
  else {
    $this
      ->drupalGet('admin/structure/types/manage/' . $content_type_id . '/moderation');
    $this
      ->assertFieldByName('workflow');
    $edit['workflow'] = 'editorial';
    $this
      ->drupalPostForm(NULL, $edit, t('Save'));
  }
}