You are here

private function SmartlingTest::requestTranslationForNode in TMGMT Translator Smartling 8

Requests translation for a given node.

Parameters

$nid:

$language:

$translator:

Return value

\Drupal\tmgmt\JobInterface

10 calls to SmartlingTest::requestTranslationForNode()
SmartlingTest::testContextSendingByCron in src/Tests/SmartlingTest.php
Test context sending by cron.
SmartlingTest::testManualContextSending in src/Tests/SmartlingTest.php
Test manual context sending.
SmartlingTest::testPushBackController in src/Tests/SmartlingTest.php
Test push back controller.
SmartlingTest::testSilentSwitchingOff in src/Tests/SmartlingTest.php
Test context uploading with turned off "Silent switching mode" feature.
SmartlingTest::testSilentSwitchingOn in src/Tests/SmartlingTest.php
Test context uploading with turned on "Silent switching mode" feature.

... See full list

File

src/Tests/SmartlingTest.php, line 163
Contains \Drupal\tmgmt_smartling\Tests\SmartlingTest.

Class

SmartlingTest
Basic tests for the Smartling translator.

Namespace

Drupal\tmgmt_smartling\Tests

Code

private 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;
}