function LocaleExportTest::testExportTranslationTemplateFile

Same name and namespace in other branches
  1. 8.9.x core/modules/locale/tests/src/Functional/LocaleExportTest.php \Drupal\Tests\locale\Functional\LocaleExportTest::testExportTranslationTemplateFile()
  2. 10 core/modules/locale/tests/src/Functional/LocaleExportTest.php \Drupal\Tests\locale\Functional\LocaleExportTest::testExportTranslationTemplateFile()
  3. 11.x 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');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.