public function LingotekNodeBulkTranslationTest::testNodeTranslationUsingActionsForMultipleLocalesAfterEditingWithPendingPhases in Lingotek Translation 4.0.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/LingotekNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkTranslationTest::testNodeTranslationUsingActionsForMultipleLocalesAfterEditingWithPendingPhases()
- 3.0.x tests/src/Functional/LingotekNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkTranslationTest::testNodeTranslationUsingActionsForMultipleLocalesAfterEditingWithPendingPhases()
- 3.1.x tests/src/Functional/LingotekNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkTranslationTest::testNodeTranslationUsingActionsForMultipleLocalesAfterEditingWithPendingPhases()
- 3.2.x tests/src/Functional/LingotekNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkTranslationTest::testNodeTranslationUsingActionsForMultipleLocalesAfterEditingWithPendingPhases()
- 3.3.x tests/src/Functional/LingotekNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkTranslationTest::testNodeTranslationUsingActionsForMultipleLocalesAfterEditingWithPendingPhases()
- 3.4.x tests/src/Functional/LingotekNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkTranslationTest::testNodeTranslationUsingActionsForMultipleLocalesAfterEditingWithPendingPhases()
- 3.5.x tests/src/Functional/LingotekNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkTranslationTest::testNodeTranslationUsingActionsForMultipleLocalesAfterEditingWithPendingPhases()
- 3.6.x tests/src/Functional/LingotekNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkTranslationTest::testNodeTranslationUsingActionsForMultipleLocalesAfterEditingWithPendingPhases()
- 3.7.x tests/src/Functional/LingotekNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkTranslationTest::testNodeTranslationUsingActionsForMultipleLocalesAfterEditingWithPendingPhases()
- 3.8.x tests/src/Functional/LingotekNodeBulkTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkTranslationTest::testNodeTranslationUsingActionsForMultipleLocalesAfterEditingWithPendingPhases()
File
- tests/
src/ Functional/ LingotekNodeBulkTranslationTest.php, line 438
Class
- LingotekNodeBulkTranslationTest
- Tests translating a node using the bulk management form.
Namespace
Drupal\Tests\lingotek\FunctionalCode
public function testNodeTranslationUsingActionsForMultipleLocalesAfterEditingWithPendingPhases() {
$this
->testNodeTranslationUsingActionsForMultipleLocales();
// Edit the node.
$edit = [];
$edit['title[0][value]'] = 'Llamas are cool EDITED';
$this
->saveAndKeepPublishedThisTranslationNodeForm($edit, 1);
$this
->goToContentBulkManagementForm();
// Let's upload the edited content so it's updated and downloadable.
$this
->clickLink('EN');
// Check the source status is current.
$this
->clickLink('EN');
// Ensure we won't get a completed document because there are phases pending.
\Drupal::state()
->set('lingotek.document_completion', FALSE);
// Check all statuses, after being edited and the source re-uploaded
// Should be in STATUS_PENDING
$this
->assertLingotekCheckTargetStatusLink('de_AT', 'dummy-document-hash-id-1');
$this
->assertLingotekCheckTargetStatusLink('es_MX', 'dummy-document-hash-id-1');
$key = $this
->getBulkSelectionKey('en', 1);
$edit = [
$key => TRUE,
$this
->getBulkOperationFormName() => $this
->getBulkOperationNameForCheckTranslations('node'),
];
$this
->drupalPostForm(NULL, $edit, $this
->getApplyActionsButtonLabel());
// Ensure that the statuses are set to PENDING since the source has been
// reuploaded and the targets are being translated. It is possible that
// some of the translation is finished and could be downloaded, but that
// should be marked as STATUS_READY_INTERIM but that has not been
// implemented yet.
// TODO: update test to check that status is STATUS_READY_INTERIM and then
// they can be downloaded and then the status is set to STATUS_INTERMEDIATE
// see ticket: https://www.drupal.org/node/2850548
// Check the status is PENDING for Spanish and German.
$this
->assertTargetStatus('DE', 'pending');
$this
->assertTargetStatus('ES', 'pending');
}