function InstallerTranslationMultipleLanguageNonInteractiveTest::verifyImportedStringsTranslated
Same name in other branches
- 9 core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageNonInteractiveTest.php \Drupal\FunctionalTests\Installer\InstallerTranslationMultipleLanguageNonInteractiveTest::verifyImportedStringsTranslated()
- 10 core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageNonInteractiveTest.php \Drupal\FunctionalTests\Installer\InstallerTranslationMultipleLanguageNonInteractiveTest::verifyImportedStringsTranslated()
Helper function to verify that the expected strings are translated.
1 call to InstallerTranslationMultipleLanguageNonInteractiveTest::verifyImportedStringsTranslated()
- InstallerTranslationMultipleLanguageNonInteractiveTest::testTranslationsLoaded in core/
tests/ Drupal/ FunctionalTests/ Installer/ InstallerTranslationMultipleLanguageNonInteractiveTest.php - Tests that translations ended up at the expected places.
File
-
core/
tests/ Drupal/ FunctionalTests/ Installer/ InstallerTranslationMultipleLanguageNonInteractiveTest.php, line 133
Class
- InstallerTranslationMultipleLanguageNonInteractiveTest
- Tests translation files for multiple languages get imported during install.
Namespace
Drupal\FunctionalTests\InstallerCode
protected function verifyImportedStringsTranslated() : void {
$test_samples = [
'Save and continue',
'Anonymous',
'Language',
];
$langcodes = [
'de',
'es',
];
foreach ($test_samples as $sample) {
foreach ($langcodes as $langcode) {
$edit = [];
$edit['langcode'] = $langcode;
$edit['translation'] = 'translated';
$edit['string'] = $sample;
$this->drupalGet('admin/config/regional/translate');
$this->submitForm($edit, 'Filter');
$this->assertSession()
->pageTextContains($sample . ' ' . $langcode);
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.