You are here

public function LocaleExportTest::testExportTranslationTemplateFile in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/locale/tests/src/Functional/LocaleExportTest.php \Drupal\Tests\locale\Functional\LocaleExportTest::testExportTranslationTemplateFile()

Test exportation of translation template file.

File

core/modules/locale/tests/src/Functional/LocaleExportTest.php, line 126

Class

LocaleExportTest
Tests the exportation of locale files.

Namespace

Drupal\Tests\locale\Functional

Code

public function testExportTranslationTemplateFile() {

  // Load an admin page with JavaScript so _drupal_add_library() fires at
  // least once and _locale_parse_js_file() gets to run at least once so that
  // the locales_source table gets populated with something.
  $this
    ->drupalGet('admin/config/regional/language');

  // Get the translation template file.
  $this
    ->drupalPostForm('admin/config/regional/translate/export', [], t('Export'));

  // Ensure we have a translation file.
  $this
    ->assertRaw('# LANGUAGE translation of PROJECT', 'Exported translation template file.');
}