You are here

public function LingotekContentModerationSettingsTest::testContentModerationStateEntityNotAvailableForLingotek in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 4.0.x tests/src/Functional/LingotekContentModerationSettingsTest.php \Drupal\Tests\lingotek\Functional\LingotekContentModerationSettingsTest::testContentModerationStateEntityNotAvailableForLingotek()
  2. 3.2.x tests/src/Functional/LingotekContentModerationSettingsTest.php \Drupal\Tests\lingotek\Functional\LingotekContentModerationSettingsTest::testContentModerationStateEntityNotAvailableForLingotek()
  3. 3.3.x tests/src/Functional/LingotekContentModerationSettingsTest.php \Drupal\Tests\lingotek\Functional\LingotekContentModerationSettingsTest::testContentModerationStateEntityNotAvailableForLingotek()
  4. 3.5.x tests/src/Functional/LingotekContentModerationSettingsTest.php \Drupal\Tests\lingotek\Functional\LingotekContentModerationSettingsTest::testContentModerationStateEntityNotAvailableForLingotek()
  5. 3.6.x tests/src/Functional/LingotekContentModerationSettingsTest.php \Drupal\Tests\lingotek\Functional\LingotekContentModerationSettingsTest::testContentModerationStateEntityNotAvailableForLingotek()
  6. 3.7.x tests/src/Functional/LingotekContentModerationSettingsTest.php \Drupal\Tests\lingotek\Functional\LingotekContentModerationSettingsTest::testContentModerationStateEntityNotAvailableForLingotek()
  7. 3.8.x tests/src/Functional/LingotekContentModerationSettingsTest.php \Drupal\Tests\lingotek\Functional\LingotekContentModerationSettingsTest::testContentModerationStateEntityNotAvailableForLingotek()

Tests that the content moderation state entity cannot be enabled for Lingotek.

File

tests/src/Functional/LingotekContentModerationSettingsTest.php, line 72

Class

LingotekContentModerationSettingsTest
Tests setting up the integration with content moderation.

Namespace

Drupal\Tests\lingotek\Functional

Code

public function testContentModerationStateEntityNotAvailableForLingotek() {
  $assert_session = $this
    ->assertSession();
  ContentLanguageSettings::loadByEntityTypeBundle('content_moderation_state', 'content_moderation_state')
    ->setLanguageAlterable(TRUE)
    ->save();
  \Drupal::service('content_translation.manager')
    ->setEnabled('content_moderation_state', 'content_moderation_state', TRUE);
  $this
    ->drupalGet('admin/lingotek/settings');
  $this
    ->assertNoField('content_moderation_state[content_moderation_state][enabled]', 'The content moderation state entity should not be available for Lingotek translation.');

  // See content_moderation_entity_bundle_info_alter().
  $this
    ->enableModerationThroughUI('article', [
    'draft',
    'needs_review',
    'published',
  ], 'draft');
  $this
    ->saveLingotekContentTranslationSettingsForNodeTypes();
  $this
    ->drupalGet('admin/lingotek/settings');
  $this
    ->assertNoField('content_moderation_state[content_moderation_state][enabled]', 'The content moderation state entity should not be available for Lingotek translation.');
}