You are here

public function LingotekNodeTranslationDownloadStatusTest::testNodeTargetDownloadSameAsSourceUnpublishedStatusTranslation in Lingotek Translation 8

Tests that a node can be translated as published when using same as source as the lingotek setting.

File

src/Tests/LingotekNodeTranslationDownloadStatusTest.php, line 137

Class

LingotekNodeTranslationDownloadStatusTest
Tests translating a node.

Namespace

Drupal\lingotek\Tests

Code

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

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

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

  // Ensure that there is more than one unpublished content.
  $this
    ->assertNoText('Published');
  $this
    ->assertNoUniqueText('Not published');
}