You are here

protected function SmartlingTestBase::createJobWithItems in TMGMT Translator Smartling 8.3

Same name and namespace in other branches
  1. 8.4 tests/src/Kernel/SmartlingTestBase.php \Drupal\Tests\tmgmt_smartling\Kernel\SmartlingTestBase::createJobWithItems()

Creates a job.

Parameters

array $settings:

string $translator:

Return value

\Drupal\tmgmt\JobInterface

15 calls to SmartlingTestBase::createJobWithItems()
BaseFlowTest::testJobCancelingLeadsToAuditLogRecordCreation in tests/src/Kernel/BaseFlowTest.php
Job canceling leads to audit log record creation.
BaseFlowTest::testJobFileDeletionInDashboardNoTranslatorAssigned in tests/src/Kernel/BaseFlowTest.php
Delete file in Smartling dashboard when corresponding TMGMT job is deleted.
BaseFlowTest::testJobFileDeletionInDashboardNotSmartlingTranslatorAssigned in tests/src/Kernel/BaseFlowTest.php
Delete file in Smartling dashboard when corresponding TMGMT job is deleted.
BaseFlowTest::testJobFileDeletionInDashboardSuccess in tests/src/Kernel/BaseFlowTest.php
Delete file in Smartling dashboard when corresponding TMGMT job is deleted.
BaseFlowTest::testTranslatorSettingsUpdateLeadsToAuditLogRecordCreation in tests/src/Kernel/BaseFlowTest.php
Translator settings update leads to audit log record creation.

... See full list

File

tests/src/Kernel/SmartlingTestBase.php, line 103

Class

SmartlingTestBase
Smartling kernel test base class.

Namespace

Drupal\Tests\tmgmt_smartling\Kernel

Code

protected function createJobWithItems(array $settings, $translator = 'smartling') {
  $job = parent::createJob();
  for ($i = 1; $i < 3; $i++) {
    $job
      ->addItem('test_source', 'test', $i);
  }
  $job->settings = $settings;
  $job->translator = $translator;
  return $job;
}