LingotekLocaleTest.php in Lingotek Translation 3.4.x
Same filename and directory in other branches
- 8.2 tests/src/Functional/LingotekLocaleTest.php
- 4.0.x tests/src/Functional/LingotekLocaleTest.php
- 3.0.x tests/src/Functional/LingotekLocaleTest.php
- 3.1.x tests/src/Functional/LingotekLocaleTest.php
- 3.2.x tests/src/Functional/LingotekLocaleTest.php
- 3.3.x tests/src/Functional/LingotekLocaleTest.php
- 3.5.x tests/src/Functional/LingotekLocaleTest.php
- 3.6.x tests/src/Functional/LingotekLocaleTest.php
- 3.7.x tests/src/Functional/LingotekLocaleTest.php
- 3.8.x tests/src/Functional/LingotekLocaleTest.php
Namespace
Drupal\Tests\lingotek\FunctionalFile
tests/src/Functional/LingotekLocaleTest.phpView source
<?php
namespace Drupal\Tests\lingotek\Functional;
use Drupal\lingotek\LingotekLocale;
use Drupal\Tests\BrowserTestBase;
/**
* Tests LingotekLocale.
*
* @ToDo: This should be unit tests!
*
* @group lingotek
*/
class LingotekLocaleTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
public function testConvertDrupal2Lingotek() {
// ToDo: Improve testing coverage.
$this
->assertIdentical('zh-hans', LingotekLocale::convertLingotek2Drupal('zh_CN'));
}
public function testConvertLingotek2Drupal() {
// ToDo: Improve testing coverage.
$this
->assertIdentical('zh_CN', LingotekLocale::convertDrupal2Lingotek('zh-hans'));
}
public function testGenerateLingotek2Drupal() {
$language = LingotekLocale::generateLingotek2Drupal('es_ES');
$this
->assertEqual('es', $language);
$language = LingotekLocale::generateLingotek2Drupal('de-AT');
$this
->assertEqual('de', $language);
$language = LingotekLocale::generateLingotek2Drupal('ar');
$this
->assertEqual('ar', $language);
}
}
Classes
Name | Description |
---|---|
LingotekLocaleTest | Tests LingotekLocale. |