You are here

public function LanguageHierarchyI18nVariableTranslationWebTestCase::testI18nVariableTranslation in Language Hierarchy 7

Test translating a variable, with hierarchy.

File

modules/i18n_variable_hierarchy/i18n_variable_hierarchy.test, line 33
Tests for Language Hierarchy module.

Class

LanguageHierarchyI18nVariableTranslationWebTestCase
Functional tests for translatable variables.

Code

public function testI18nVariableTranslation() {
  $this
    ->loginAdminUser();

  // Add languages used by this test case.
  $this
    ->addLanguages();
  $this
    ->drupalLogout();
  $parent_translation = $this
    ->randomName(10);
  $child_translation = $this
    ->randomName(10);
  i18n_variable_set('site_slogan', $parent_translation, 'pt');
  i18n_variable_set('site_slogan', $child_translation, 'pt-pt');
  $this
    ->assertEqual($parent_translation, i18n_variable_get('site_slogan', 'pt-br'));
  $this
    ->assertEqual($child_translation, i18n_variable_get('site_slogan', 'pt-pt'));
}