function LocaleFileImportStatus::testBulkImport

Test the basic bulk import functionality.

File

drupal/core/modules/locale/lib/Drupal/locale/Tests/LocaleFileImportStatus.php, line 107
Definition of Drupal\locale\Tests\LocaleFileImportStatus.

Class

LocaleFileImportStatus
Functional tests for the import of translation files.

Namespace

Drupal\locale\Tests

Code

function testBulkImport() {
  $langcode = 'de';

  // Translations should not exist.
  $strings = array(
    'Monday' => '',
    'Tuesday' => '',
  );
  $this
    ->checkTranslations($strings, $langcode);

  // Add language.
  $this
    ->addLanguage($langcode);

  // The file was imported, translations should exist.
  $strings = array(
    'Monday' => 'Montag',
    'Tuesday' => 'Dienstag',
  );
  $this
    ->checkTranslations($strings, $langcode);
}