function LocaleImportFunctionalTest::testLanguageContext

Test msgctxt context support.

File

drupal/modules/locale/locale.test, line 1060
Tests for locale.module.

Class

LocaleImportFunctionalTest
Functional tests for the import of translation files.

Code

function testLanguageContext() {

  // Try importing a .po file.
  $this
    ->importPoFile($this
    ->getPoFileWithContext(), array(
    'langcode' => 'hr',
  ));
  $this
    ->assertIdentical(t('May', array(), array(
    'langcode' => 'hr',
    'context' => 'Long month name',
  )), 'Svibanj', 'Long month name context is working.');
  $this
    ->assertIdentical(t('May', array(), array(
    'langcode' => 'hr',
  )), 'Svi.', 'Default context is working.');
}