You are here

public function LingotekNotEnabledNodeBulkTranslationTest::testNodeTranslationUsingLinks in Lingotek Translation 3.0.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/LingotekNotEnabledNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNotEnabledNodeBulkTranslationTest::testNodeTranslationUsingLinks()
  2. 3.1.x tests/src/Functional/LingotekNotEnabledNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNotEnabledNodeBulkTranslationTest::testNodeTranslationUsingLinks()

Tests that a node can be translated using the links on the management page.

File

tests/src/Functional/LingotekNotEnabledNodeBulkTranslationTest.php, line 64

Class

LingotekNotEnabledNodeBulkTranslationTest
Tests what happens when uploading a not enabled node using the bulk management form.

Namespace

Drupal\Tests\lingotek\Functional

Code

public function testNodeTranslationUsingLinks() {

  // Create a node.
  $edit = [];
  $edit['title[0][value]'] = 'Llamas are cool';
  $edit['body[0][value]'] = 'Llamas are very cool';
  $this
    ->saveAndPublishNodeForm($edit, 'page');

  // Login as translation manager.
  $this
    ->drupalLogin($this->translationManagerUser);
  $this
    ->goToContentBulkManagementForm();

  // Clicking English must init the upload of content.
  $this
    ->assertLingotekUploadLink();

  // And we cannot request yet a translation.
  $this
    ->assertNoLingotekRequestTranslationLink('es_MX');
  $this
    ->clickLink('EN');
  $this
    ->assertText('The upload for node Llamas are cool failed. Check your configuration and profile and try again.');
  $this
    ->assertNull(\Drupal::state()
    ->get('lingotek.uploaded_locale'));
  $this
    ->assertNoSourceStatus('EN', Lingotek::STATUS_IMPORTING);
  $this
    ->assertSourceStatus('EN', Lingotek::STATUS_UNTRACKED);
  $this
    ->assertLingotekUploadLink();
}