You are here

protected function SmartlingTestBase::setUpSmartlingProviderSettings in TMGMT Translator Smartling 8.4

Same name and namespace in other branches
  1. 8.3 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

24 calls to SmartlingTestBase::setUpSmartlingProviderSettings()
BaseFlowTest::testUploadFileAndDownloadTranslation in tests/src/Functional/BaseFlowTest.php
Test upload and download translation.
ContextTest::testContextSendingByCron in tests/src/Functional/ContextTest.php
Test context sending by cron.
ContextTest::testManualContextSending in tests/src/Functional/ContextTest.php
Test manual context sending.
ContextTest::testOverrideContextOption in tests/src/Functional/ContextTest.php
Test override context css class.
ContextTest::testSilentSwitchingOff in tests/src/Functional/ContextTest.php
Test context uploading with turned off "Silent switching mode" feature.

... See full list

File

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

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]'],
      'translatable_attributes' => $providerSettings['settings[translatable_attributes]'],
      'exclude_translatable_attributes' => $providerSettings['settings[exclude_translatable_attributes]'],
      'force_block_for_tags' => $providerSettings['settings[force_block_for_tags]'],
      'enable_smartling_logging' => $providerSettings['settings[enable_smartling_logging]'],
      'enable_notifications' => $providerSettings['settings[enable_notifications]'],
      'download_by_job_items' => $providerSettings['settings[download_by_job_items]'],
    ],
  ]);
  return $translator;
}