You are here

protected function TmgmtExtensionSuitTestBase::requestTranslation in TMGMT Extension Suite 8.2

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/TmgmtExtensionSuitTestBase.php \Drupal\Tests\tmgmt_extension_suit\Functional\TmgmtExtensionSuitTestBase::requestTranslation()

Requests nodes for translation.

Parameters

array $nids:

$targetLanguage:

$jobId:

3 calls to TmgmtExtensionSuitTestBase::requestTranslation()
CheckEntityChangesTest::testDoNotTrackTranslatableEntityChanges in tests/src/Functional/CheckEntityChangesTest.php
Test "Track changes of the translatable entities" feature is turned off.
CheckEntityChangesTest::testTrackTranslatableEntityChanges in tests/src/Functional/CheckEntityChangesTest.php
Test "Track changes of the translatable entities" feature is turned on.
CheckStatusTest::testCheckStatus in tests/src/Functional/CheckStatusTest.php
Test tmgmt_extension_suit_add_to_check_status() function.

File

tests/src/Functional/TmgmtExtensionSuitTestBase.php, line 85

Class

TmgmtExtensionSuitTestBase
Basic class for tmgmt extension module.

Namespace

Drupal\Tests\tmgmt_extension_suit\Functional

Code

protected function requestTranslation(array $nids, $targetLanguage, $jobId) {

  // Request nodes for translation.
  $data = [];
  foreach ($nids as $nid) {
    $data["items[{$nid}]"] = "item[{$nid}]";
  }
  $this
    ->drupalPostForm('admin/tmgmt/sources', $data, t('Request translation'));
  $data = [
    'label[0][value]' => 'Test job',
    'target_language' => $targetLanguage,
    'translator' => 'local',
  ];
  $this
    ->drupalPostForm("admin/tmgmt/jobs/{$jobId}", $data, t('Submit to provider'));
}