You are here

protected function SmartlingTestBase::setUpSmartlingProviderSettings in TMGMT Translator Smartling 8.3

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

Sets up Smartling provider settings and returns translator plugin.

Parameters

array $providerSettings:

Return value

\Drupal\tmgmt\TranslatorInterface

30 calls to SmartlingTestBase::setUpSmartlingProviderSettings()
BaseFlowTest::testJobRejectionOnFileNotFoundExceptionWhileCheckingStatus in tests/src/Functional/BaseFlowTest.php
Test job rejection on "file.not.found" exception while checking status.
BaseFlowTest::testJobRejectionOnLocaleDisabledExceptionWhileCheckingStatus in tests/src/Functional/BaseFlowTest.php
Test job rejection on "locale.disabled" exception while checking status.
BaseFlowTest::testJobRejectionOnLocaleNotFoundExceptionWhileCheckingStatus in tests/src/Functional/BaseFlowTest.php
Test job rejection on "locale.not.found" exception while checking status.
BaseFlowTest::testUploadFileAndDownloadTranslation in tests/src/Functional/BaseFlowTest.php
Test upload and download translation.
BaseFlowTest::testUploadXlfChangeToXmlDownloadXlf in tests/src/Functional/BaseFlowTest.php
Test uploading/downloading xlf file: rely on file name in tmgmt_job.

... See full list

File

tests/src/Functional/SmartlingTestBase.php, line 152

Class

SmartlingTestBase
Basic tests for the Smartling translator.

Namespace

Drupal\Tests\tmgmt_smartling\Functional

Code

protected function setUpSmartlingProviderSettings(array $providerSettings) {
  $translator = $this
    ->createTranslator([
    'plugin' => 'smartling',
    'auto_accept' => $providerSettings['auto_accept'],
    'settings' => [
      'project_id' => $providerSettings['settings[project_id]'],
      'user_id' => $providerSettings['settings[user_id]'],
      'token_secret' => $providerSettings['settings[token_secret]'],
      'contextUsername' => $providerSettings['settings[contextUsername]'],
      'context_silent_user_switching' => $providerSettings['settings[context_silent_user_switching]'],
      'retrieval_type' => $providerSettings['settings[retrieval_type]'],
      'auto_authorize_locales' => $providerSettings['settings[auto_authorize_locales]'],
      'callback_url_use' => $providerSettings['settings[callback_url_use]'],
      'callback_url_host' => $providerSettings['settings[callback_url_host]'],
      'scheme' => $providerSettings['settings[scheme]'],
      'custom_regexp_placeholder' => $providerSettings['settings[custom_regexp_placeholder]'],
      'export_format' => $providerSettings['settings[export_format]'],
      'enable_smartling_logging' => $providerSettings['settings[enable_smartling_logging]'],
      'enable_notifications' => $providerSettings['settings[enable_notifications]'],
    ],
  ]);
  return $translator;
}