You are here

protected function TmgmtExtensionSuitTestBase::requestTranslation in TMGMT Extension Suite 8.3

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

Requests nodes for translation.

Parameters

array $nids: Node ids.

string $targetLanguage: Target locale.

int $jobId: Job id.

string $translator: Translator id.

6 calls to TmgmtExtensionSuitTestBase::requestTranslation()
CheckEntityChangesTest::testDoNotTrackTranslatableEntityChanges in tests/src/Functional/CheckEntityChangesTest.php
Test "Track changes of the translatable entities" feature is turned off.
CheckEntityChangesTest::testDoNotTrackTranslatableEntityChangesIfNoLanguagesSelected in tests/src/Functional/CheckEntityChangesTest.php
Test "Track changes of the translatable entities" feature is turned on.
CheckEntityChangesTest::testTrackTranslatableEntityChanges in tests/src/Functional/CheckEntityChangesTest.php
Test "Track changes of the translatable entities" feature is turned on.
CheckEntityChangesTest::testTrackTranslatableEntityChangesAllLanguagesSelected in tests/src/Functional/CheckEntityChangesTest.php
Test "Track changes of the translatable entities" feature is turned on.
CheckEntityChangesTest::testTrackTranslatableEntityChangesNotAllLanguagesSelected in tests/src/Functional/CheckEntityChangesTest.php
Test "Track changes of the translatable entities" feature is turned on.

... See full list

File

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

Class

TmgmtExtensionSuitTestBase
Basic class for tmgmt extension module.

Namespace

Drupal\Tests\tmgmt_extension_suit\Functional

Code

protected function requestTranslation(array $nids, $targetLanguage, $jobId, $translator = 'tes_local_test') {

  // 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' => $translator,
  ];
  $this
    ->drupalPostForm("admin/tmgmt/jobs/{$jobId}", $data, t('Submit to provider'));
}