You are here

public function LingotekNodeBulkLocaleTranslationTest::testSourceUpdatedAfterRequestingTranslation in Lingotek Translation 3.7.x

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

Tests that source is updated after requesting translation.

File

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

Class

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

Namespace

Drupal\Tests\lingotek\Functional

Code

public function testSourceUpdatedAfterRequestingTranslation() {

  // 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('DE-AT');
  $this
    ->assertText("Locale 'de_AT' was added as a translation target for node Llamas are cool.");

  // Check that the source status has been updated.
  $this
    ->assertNoLingotekCheckSourceStatusLink();
}