SettingsFormTest.php in TMGMT Translator Smartling 8.4
File
tests/src/Functional/SettingsFormTest.php
View source
<?php
namespace Drupal\Tests\tmgmt_smartling\Functional;
class SettingsFormTest extends SmartlingTestBase {
public function testValidationWrongParameters() {
if (!empty($this->smartlingPluginProviderSettings)) {
$settings = $this->smartlingPluginProviderSettings;
$settings['settings[project_id]'] = $this
->randomString();
$settings['settings[user_id]'] = $this
->randomString();
$settings['settings[token_secret]'] = $this
->randomString();
$settings['settings[key]'] = $this
->randomString();
$translator = $this
->setUpSmartlingProviderSettings($settings);
$supported_remote_languages = $translator
->getPlugin()
->getSupportedRemoteLanguages($translator);
$this
->assertEqual(0, count($supported_remote_languages));
}
else {
$this
->fail("Smartling settings file for simpletests not found.");
}
}
public function testValidationCorrectParameters() {
if (!empty($this->smartlingPluginProviderSettings)) {
$translator = $this
->setUpSmartlingProviderSettings($this->smartlingPluginProviderSettings);
$supported_remote_languages = $translator
->getPlugin()
->getSupportedRemoteLanguages($translator);
$this
->assertNotEqual(0, count($supported_remote_languages));
}
else {
$this
->fail("Smartling settings file for simpletests not found.");
}
}
}