You are here

public function LingotekNodeTranslationTest::testAddingContentInDifferentLocale in Lingotek Translation 3.4.x

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

Test that when a node is uploaded in a different locale that locale is used.

File

tests/src/Functional/LingotekNodeTranslationTest.php, line 400

Class

LingotekNodeTranslationTest
Tests translating a node.

Namespace

Drupal\Tests\lingotek\Functional

Code

public function testAddingContentInDifferentLocale() {

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

  // Create a node.
  $edit = [];
  $edit['title[0][value]'] = 'Llamas are cool es-MX';
  $edit['body[0][value]'] = 'Llamas are very cool es-MX';
  $edit['langcode[0][value]'] = 'es';
  $this
    ->saveAndPublishNodeForm($edit);
  $this
    ->assertText('Llamas are cool es-MX sent to Lingotek successfully.');
  $this
    ->assertIdentical('es_MX', \Drupal::state()
    ->get('lingotek.uploaded_locale'));
}