public function LingotekContentTypeBulkTranslationTest::testEditedConfigTranslationUsingLinksInAutomaticUploadMode in Lingotek Translation 3.3.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/LingotekContentTypeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkTranslationTest::testEditedConfigTranslationUsingLinksInAutomaticUploadMode()
- 4.0.x tests/src/Functional/LingotekContentTypeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkTranslationTest::testEditedConfigTranslationUsingLinksInAutomaticUploadMode()
- 3.0.x tests/src/Functional/LingotekContentTypeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkTranslationTest::testEditedConfigTranslationUsingLinksInAutomaticUploadMode()
- 3.1.x tests/src/Functional/LingotekContentTypeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkTranslationTest::testEditedConfigTranslationUsingLinksInAutomaticUploadMode()
- 3.2.x tests/src/Functional/LingotekContentTypeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkTranslationTest::testEditedConfigTranslationUsingLinksInAutomaticUploadMode()
- 3.4.x tests/src/Functional/LingotekContentTypeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkTranslationTest::testEditedConfigTranslationUsingLinksInAutomaticUploadMode()
- 3.5.x tests/src/Functional/LingotekContentTypeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkTranslationTest::testEditedConfigTranslationUsingLinksInAutomaticUploadMode()
- 3.6.x tests/src/Functional/LingotekContentTypeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkTranslationTest::testEditedConfigTranslationUsingLinksInAutomaticUploadMode()
- 3.7.x tests/src/Functional/LingotekContentTypeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkTranslationTest::testEditedConfigTranslationUsingLinksInAutomaticUploadMode()
- 3.8.x tests/src/Functional/LingotekContentTypeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkTranslationTest::testEditedConfigTranslationUsingLinksInAutomaticUploadMode()
Tests that a node can be translated using the links on the management page.
File
- tests/
src/ Functional/ LingotekContentTypeBulkTranslationTest.php, line 309
Class
- LingotekContentTypeBulkTranslationTest
- Tests translating a config entity using the bulk management form.
Namespace
Drupal\Tests\lingotek\FunctionalCode
public function testEditedConfigTranslationUsingLinksInAutomaticUploadMode() {
$assert_session = $this
->assertSession();
// We need a node with translations first.
$this
->testContentTypeTranslationUsingLinks();
// Set upload as automatic.
$this
->saveLingotekConfigTranslationSettings([
'node_type' => 'automatic',
]);
// Add a language so we can check that it's not marked as dirty if there are
// no translations.
ConfigurableLanguage::createFromLangcode('eu')
->setThirdPartySetting('lingotek', 'locale', 'eu_ES')
->save();
// Edit the object
$this
->drupalPostForm('/admin/structure/types/manage/article', [
'name' => 'Article EDITED',
], t('Save content type'));
// Go to the bulk config management page.
$this
->goToConfigBulkManagementForm('node_type');
// The source status is 'Importing' because of automatic upload.
$this
->assertSourceStatus('EN', Lingotek::STATUS_IMPORTING);
// Check the target statuses are not affected, but the current is back to pending.
$this
->assertTargetStatus('ES', Lingotek::STATUS_PENDING);
$this
->assertTargetStatus('EU', Lingotek::STATUS_REQUEST);
// Recheck status.
$this
->clickLink('EN');
$this
->assertText('Article EDITED status checked successfully');
// Check the translation after having been edited.
$edit = [
'table[article]' => TRUE,
$this
->getBulkOperationFormName() => $this
->getBulkOperationNameForCheckTranslations('node_type'),
];
$this
->drupalPostForm(NULL, $edit, $this
->getApplyActionsButtonLabel());
$this
->assertText('Operations completed.');
// Download the translation.
$this
->clickLink('ES');
$this
->assertText('Translation to es_MX downloaded successfully');
}