You are here

function TMGMTPluginsTestCase::createJob in Translation Management Tool 7

Creates, saves and returns a translation job.

Return value

TMGMTJob

Overrides TMGMTBaseTestCase::createJob

1 call to TMGMTPluginsTestCase::createJob()
TMGMTPluginsTestCase::testBasicWorkflow in tests/tmgmt.plugin.test

File

tests/tmgmt.plugin.test, line 21

Class

TMGMTPluginsTestCase
Tests interaction between core and the plugins.

Code

function createJob($source = 'en', $target = 'de', $uid = 1) {
  $job = parent::createJob();
  for ($i = 1; $i < 3; $i++) {
    if ($i == 3) {

      // Explicitly define the data for the third item.
      $data['data'] = array(
        'dummy' => array(
          'deep_nesting' => array(
            '#text' => 'Stored data',
          ),
        ),
      );
      $job
        ->addItem('test_source', 'test', $i, array(
        $data,
      ));
    }
    $job
      ->addItem('test_source', 'test', $i);
  }

  // Manually specify the translator for now.
  $job->translator = $this->default_translator->name;
  return $job;
}