You are here

public function LingotekNodeBulkLocaleTranslationTest::testDownloadAllWithoutSplitDownload in Lingotek Translation 3.2.x

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

Tests that download uses one batch for downloading all translations.

File

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

Class

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

Namespace

Drupal\Tests\lingotek\Functional

Code

public function testDownloadAllWithoutSplitDownload() {

  // Login as admin.
  $this
    ->drupalLogin($this->rootUser);

  // 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);
}