| 7 locale.test | LocaleExportFunctionalTest::testExportTranslation() |
| 8 locale.test | LocaleExportFunctionalTest::testExportTranslation() |
Test exportation of translations.
File
- modules/
locale/ locale.test, line 1289 - Tests for locale.module.
Code
function testExportTranslation() {
// First import some known translations.
// This will also automatically enable the 'fr' language.
$name = tempnam('temporary://', "po_") . '.po';
file_put_contents($name, $this->getPoFile());
$this->drupalPost('admin/config/regional/translate/import', array(
'langcode' => 'fr',
'files[file]' => $name,
), t('Import'));
drupal_unlink($name);
// Get the French translations.
$this->drupalPost('admin/config/regional/translate/export', array(
'langcode' => 'fr',
), t('Export'));
// Ensure we have a translation file.
$this->assertRaw('# French translation of Drupal', t('Exported French translation file.'));
// Ensure our imported translations exist in the file.
$this->assertRaw('msgstr "lundi"', t('French translations present in exported file.'));
}
Login or register to post comments