You are here

public function LingotekNodeTranslationDownloadStatusTest::testNodeTargetDownloadUnpublishedStatusTranslation in Lingotek Translation 8

Tests that a node can be translated and set to unpublished based on the lingotek setting.

File

src/Tests/LingotekNodeTranslationDownloadStatusTest.php, line 80

Class

LingotekNodeTranslationDownloadStatusTest
Tests translating a node.

Namespace

Drupal\lingotek\Tests

Code

public function testNodeTargetDownloadUnpublishedStatusTranslation() {
  $edit = [
    'target_download_status' => 'unpublished',
  ];
  $this
    ->drupalPostForm('admin/lingotek/settings', $edit, 'Save', [], [], 'lingoteksettings-tab-preferences-form');

  // Assert the settings are saved successfully.
  $this
    ->assertOptionSelected('edit-target-download-status', 'unpublished');

  // Create a node and complete the translation with Lingotek.
  $this
    ->createAndDownloadANodeTranslation(self::PUBLISHED);

  // Ensure that there is one and only one unpublished content.
  $this
    ->assertText('Not published');
  $this
    ->assertUniqueText('Not published');
}