private function SmartlingTest::setUpSmartlingProviderSettings in TMGMT Translator Smartling 8
Sets up Smartling provider settings and returns translator plugin.
Parameters
array $providerSettings:
Return value
\Drupal\tmgmt\TranslatorInterface
11 calls to SmartlingTest::setUpSmartlingProviderSettings()
- SmartlingTest::testContextSendingByCron in src/
Tests/ SmartlingTest.php - Test context sending by cron.
- SmartlingTest::testManualContextSending in src/
Tests/ SmartlingTest.php - Test manual context sending.
- SmartlingTest::testPushBackController in src/
Tests/ SmartlingTest.php - Test push back controller.
- SmartlingTest::testSilentSwitchingOff in src/
Tests/ SmartlingTest.php - Test context uploading with turned off "Silent switching mode" feature.
- SmartlingTest::testSilentSwitchingOn in src/
Tests/ SmartlingTest.php - Test context uploading with turned on "Silent switching mode" feature.
File
- src/
Tests/ SmartlingTest.php, line 131 - Contains \Drupal\tmgmt_smartling\Tests\SmartlingTest.
Class
- SmartlingTest
- Basic tests for the Smartling translator.
Namespace
Drupal\tmgmt_smartling\TestsCode
private function setUpSmartlingProviderSettings(array $providerSettings) {
$translator = $this
->createTranslator([
'plugin' => 'smartling',
'auto_accept' => $providerSettings['auto_accept'],
'settings' => [
'api_url' => $providerSettings['settings[api_url]'],
'project_id' => $providerSettings['settings[project_id]'],
'key' => $providerSettings['settings[key]'],
'orgID' => $providerSettings['settings[orgID]'],
'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]'],
'scheme' => $providerSettings['settings[scheme]'],
'custom_regexp_placeholder' => $providerSettings['settings[custom_regexp_placeholder]'],
'export_format' => $providerSettings['settings[export_format]'],
],
]);
return $translator;
}