You are here

public function TMGMTLocaleSourceTestCase::assertTranslation in Translation Management Tool 7

Asserts a locale translation.

Parameters

int $lid: The locale source id.

string $target_langcode: The target language code.

string $expected_translation: The expected translation.

1 call to TMGMTLocaleSourceTestCase::assertTranslation()
TMGMTLocaleSourceTestCase::testSingularTerm in sources/locale/tmgmt_locale.test
Tests translation of a locale singular term.

File

sources/locale/tmgmt_locale.test, line 224

Class

TMGMTLocaleSourceTestCase
Basic Locale Source tests.

Code

public function assertTranslation($lid, $target_langcode, $expected_translation) {
  $actual_translation = db_query('SELECT translation FROM {locales_target} WHERE lid = :lid AND language = :language', array(
    ':lid' => $lid,
    ':language' => $target_langcode,
  ))
    ->fetchField();
  $this
    ->assertEqual($actual_translation, $expected_translation);
}