function TMGMTTestBase::createJob

Creates, saves and returns a translation job.

Return value

\Drupal\tmgmt\JobInterface

File

src/Tests/TMGMTTestBase.php, line 179

Class

TMGMTTestBase
Base class for tests.

Namespace

Drupal\tmgmt\Tests

Code

function createJob($source = 'en', $target = 'de', $uid = 1, $values = array()) {
  $job = tmgmt_job_create($source, $target, $uid, $values);
  $this
    ->assertEqual(SAVED_NEW, $job
    ->save());

  // Assert that the translator was assigned a tid.
  $this
    ->assertTrue($job
    ->id() > 0);
  return $job;
}