You are here

public function LocaleExportTest::testExportTranslationTemplateFile in Drupal 9

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

Tests exportation of translation template file.

File

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

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
    ->drupalGet('admin/config/regional/translate/export');
  $this
    ->submitForm([], 'Export');

  // Ensure we have a translation file.
  $this
    ->assertSession()
    ->pageTextContains('# LANGUAGE translation of PROJECT');
}