public function LingotekNodeBulkTranslationTest::testAddingContentInDifferentLocale in Lingotek Translation 3.4.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/LingotekNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkTranslationTest::testAddingContentInDifferentLocale()
- 4.0.x tests/src/Functional/LingotekNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkTranslationTest::testAddingContentInDifferentLocale()
- 3.0.x tests/src/Functional/LingotekNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkTranslationTest::testAddingContentInDifferentLocale()
- 3.1.x tests/src/Functional/LingotekNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkTranslationTest::testAddingContentInDifferentLocale()
- 3.2.x tests/src/Functional/LingotekNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkTranslationTest::testAddingContentInDifferentLocale()
- 3.3.x tests/src/Functional/LingotekNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkTranslationTest::testAddingContentInDifferentLocale()
- 3.5.x tests/src/Functional/LingotekNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkTranslationTest::testAddingContentInDifferentLocale()
- 3.6.x tests/src/Functional/LingotekNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkTranslationTest::testAddingContentInDifferentLocale()
- 3.7.x tests/src/Functional/LingotekNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkTranslationTest::testAddingContentInDifferentLocale()
- 3.8.x tests/src/Functional/LingotekNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkTranslationTest::testAddingContentInDifferentLocale()
Test that when a node is uploaded in a different locale that locale is used.
File
- tests/
src/ Functional/ LingotekNodeBulkTranslationTest.php, line 804
Class
- LingotekNodeBulkTranslationTest
- Tests translating a node using the bulk management form.
Namespace
Drupal\Tests\lingotek\FunctionalCode
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';
$edit['lingotek_translation_management[lingotek_translation_profile]'] = 'manual';
$this
->saveAndPublishNodeForm($edit);
$this
->goToContentBulkManagementForm('node', 'es');
// Clicking Spanish must init the upload of content.
$this
->assertLingotekUploadLink(1, 'node', 'es');
// And we cannot request yet a translation.
$this
->assertNoLingotekRequestTranslationLink('en_US', 'dummy-document-hash-id', 'node', 'es');
$this
->clickLink('ES');
$this
->assertText('Node Llamas are cool es-MX has been uploaded.');
$this
->assertIdentical('es_MX', \Drupal::state()
->get('lingotek.uploaded_locale'));
}