Commit df2c0751 authored by Loparev's avatar Loparev
Browse files

Fixed failing tests

parent 9067b3db
......@@ -18,6 +18,13 @@ class TmgmtSmartlingLogSettingsTest extends BrowserTestBase {
*/
public static $modules = ['tmgmt_smartling_log_settings'];
/**
* Default theme.
*
* @var string
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
......
......@@ -7,6 +7,7 @@
namespace Drupal\tmgmt_smartling\Smartling;
use Drupal\Core\Extension\Exception\UnknownExtensionException;
use Smartling\BaseApiAbstract;
/**
......@@ -32,7 +33,15 @@ class ConnectorInfo {
* @return string
*/
public static function getLibVersion($name = 'tmgmt_smartling', $default = 'unknown') {
$info = \Drupal::service('extension.list.module')->getExtensionInfo($name);
try {
$info = \Drupal::service('extension.list.module')->getExtensionInfo($name);
}
catch (UnknownExtensionException $e) {
$info = [
'version' => $default,
];
}
$client_version = $default;
if (!empty($info['version'])) {
......
......@@ -101,7 +101,7 @@ class SmartlingTranslatorTest extends SmartlingTestBase {
->exportToArray();
$this->assertEquals($actual['authorize'], FALSE);
$this->assertTrue(preg_match('/^{"client":"smartling-api-sdk-php","version":"\d+\.\d+\.\d+"}$/', $actual['smartling.client_lib_id']));
$this->assertTrue((bool) preg_match('/^{"client":"smartling-api-sdk-php","version":"\d+\.\d+\.\d+"}$/', $actual['smartling.client_lib_id']));
$this->assertEquals($actual['smartling.translate_paths'], 'html/body/div/div, html/body/div/span');
$this->assertEquals($actual['smartling.string_format_paths'], 'html : html/body/div/div, @default : html/body/div/span');
$this->assertEquals($actual['smartling.variants_enabled'], 'true');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment