protected function TMGMTKernelTestBase::createJob in Translation Management Tool 8
Creates, saves and returns a translation job.
Parameters
string $source: The source langcode.
string $target: The target langcode.
int $uid: The user ID.
array $values: (Optional) An array of additional entity values.
Return value
\Drupal\tmgmt\JobInterface A new job. A new job.
15 calls to TMGMTKernelTestBase::createJob()
- ContentEntitySuggestionsTest::testSuggestions in sources/
content/ tests/ src/ Kernel/ ContentEntitySuggestionsTest.php - Test suggested entities from a translation job.
- CrudTest::testAddingTranslatedData in tests/
src/ Kernel/ CrudTest.php - Tests adding translated data and revision handling.
- CrudTest::testContinuousTranslators in tests/
src/ Kernel/ CrudTest.php - Test crud operations of jobs.
- CrudTest::testJobItems in tests/
src/ Kernel/ CrudTest.php - Test crud operations of job items.
- CrudTest::testJobItemsCounters in tests/
src/ Kernel/ CrudTest.php - Test the calculations of the counters.
File
- tests/
src/ Kernel/ TMGMTKernelTestBase.php, line 85
Class
- TMGMTKernelTestBase
- Base class for tests.
Namespace
Drupal\Tests\tmgmt\KernelCode
protected function createJob($source = 'en', $target = 'de', $uid = 0, array $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;
}