You are here

public function LingotekNodeBulkLocaleTranslationTest::testDownloadAllWithSplitDownload in Lingotek Translation 3.6.x

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

Tests that download uses one batch for downloading all translations.

File

tests/src/Functional/LingotekNodeBulkLocaleTranslationTest.php, line 202

Class

LingotekNodeBulkLocaleTranslationTest
Tests translating a node into locales using the bulk management form.

Namespace

Drupal\Tests\lingotek\Functional

Code

public function testDownloadAllWithSplitDownload() {
  $this
    ->drupalGet('admin/lingotek/settings');
  $edit = [
    'split_download_all' => TRUE,
  ];
  $this
    ->submitForm($edit, 'Save', 'lingoteksettings-tab-preferences-form');

  // Create a node.
  $edit = [];
  $edit['title[0][value]'] = 'Llamas are cool';
  $edit['body[0][value]'] = 'Llamas are very cool';
  $edit['langcode[0][value]'] = 'en';
  $edit['lingotek_translation_management[lingotek_translation_profile]'] = 'automatic';
  $this
    ->saveAndPublishNodeForm($edit);
  $this
    ->goToContentBulkManagementForm();

  // There is a link for checking status.
  $this
    ->assertLingotekCheckSourceStatusLink();

  // And we can already request a translation.
  $this
    ->assertLingotekRequestTranslationLink('de_AT', 'dummy-document-hash-id');

  // Request the German (AT) translation.
  $this
    ->assertLingotekRequestTranslationLink('de_AT', 'dummy-document-hash-id');
  $this
    ->clickLink('ES-ES');
  $this
    ->assertText("Locale 'es_ES' was added as a translation target for node Llamas are cool.");
  $this
    ->clickLink('DE-AT');
  $this
    ->assertText("Locale 'de_AT' was added as a translation target for node Llamas are cool.");
  $key = $this
    ->getBulkSelectionKey('en', 1);
  $edit = [
    $key => TRUE,
    $this
      ->getBulkOperationFormName() => $this
      ->getBulkOperationNameForDownloadTranslations('node'),
  ];
  $this
    ->drupalPostForm(NULL, $edit, $this
    ->getApplyActionsButtonLabel());
  $this
    ->assertTargetStatus('DE-AT', Lingotek::STATUS_CURRENT);
  $this
    ->assertTargetStatus('ES-ES', Lingotek::STATUS_CURRENT);
  $this
    ->assertTargetStatus('ES', Lingotek::STATUS_REQUEST);
}