function TmgmtTestTrait::createJob

Creates, saves and returns a translation job.

Return value

\Drupal\tmgmt\JobInterface

30 calls to TmgmtTestTrait::createJob()
ConfigSourceUiTest::testFieldConfigTranslateTabSingleCheckout in sources/tmgmt_config/tests/src/Functional/ConfigSourceUiTest.php
Test the field config entity type for a single checkout.
ContentEntitySourceTranslatableEntityTest::testTranslatableEntityReferences in sources/content/tests/src/Functional/ContentEntitySourceTranslatableEntityTest.php
Tests that the referenced entities are always embedded.
ContentTmgmtEntitySourceListTest::testTranslationStatuses in sources/content/tests/src/Functional/ContentTmgmtEntitySourceListTest.php
ContentTmgmtEntitySourceUiTest::testConsiderFieldSequences in sources/content/tests/src/Functional/ContentTmgmtEntitySourceUiTest.php
Test consider field sequences.
ContentTmgmtEntitySourceUiTest::testEmbeddedReferences in sources/content/tests/src/Functional/ContentTmgmtEntitySourceUiTest.php
Tests the embedded references.

... See full list

File

tests/src/Functional/TmgmtTestTrait.php, line 137

Class

TmgmtTestTrait
Base class for tests.

Namespace

Drupal\Tests\tmgmt\Functional

Code

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

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