You are here

protected function SmartlingTestBase::requestTranslationForNode in TMGMT Translator Smartling 8.2

Requests translation for a given node.

Parameters

$nid:

$language:

$translator:

Return value

\Drupal\tmgmt\JobInterface

22 calls to SmartlingTestBase::requestTranslationForNode()
BaseFlowTest::testRevisionInflation in src/Tests/BaseFlowTest.php
Test revision inflation.
BaseFlowTest::testUploadFileAndDownloadTranslation in src/Tests/BaseFlowTest.php
Test upload and download translation.
BaseFlowTest::testUploadXlfChangeToXmlDownloadXlf in src/Tests/BaseFlowTest.php
Test uploading/downloading xlf file: rely on file name in tmgmt_job.
BaseFlowTest::testUploadXmlChangeToXlfDownloadXml in src/Tests/BaseFlowTest.php
Test uploading/downloading xml file: rely on file name in tmgmt_job.
ContextTest::testContextSendingByCron in src/Tests/ContextTest.php
Test context sending by cron.

... See full list

File

src/Tests/SmartlingTestBase.php, line 173

Class

SmartlingTestBase
Basic tests for the Smartling translator.

Namespace

Drupal\tmgmt_smartling\Tests

Code

protected function requestTranslationForNode($nid, $language, $translator) {
  $job = $this
    ->createJob($this->sourceLanguage, $language, 1, [
    'label' => 'Job for ' . $nid,
    'job_type' => Job::TYPE_NORMAL,
  ]);
  $job->translator = $translator;
  $job
    ->addItem('content', 'node', $nid);
  $job
    ->setState(JobInterface::STATE_ACTIVE);
  $job
    ->requestTranslation();
  return $job;
}