protected function LocaleUpdateBase::addLanguage in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/locale/src/Tests/LocaleUpdateBase.php \Drupal\locale\Tests\LocaleUpdateBase::addLanguage()
Adds a language.
Parameters
string $langcode: The language code of the language to add.
3 calls to LocaleUpdateBase::addLanguage()
- LocaleUpdateCronTest::setUp in core/
modules/ locale/ src/ Tests/ LocaleUpdateCronTest.php - Sets up a Drupal site for running functional and integration tests.
- LocaleUpdateInterfaceTest::testInterface in core/
modules/ locale/ src/ Tests/ LocaleUpdateInterfaceTest.php - Tests the user interfaces of the interface translation update system.
- LocaleUpdateTest::setUp in core/
modules/ locale/ src/ Tests/ LocaleUpdateTest.php - Sets up a Drupal site for running functional and integration tests.
File
- core/
modules/ locale/ src/ Tests/ LocaleUpdateBase.php, line 91 - Contains \Drupal\locale\Tests\LocaleUpdateBase.
Class
- LocaleUpdateBase
- Base class for testing updates to string translations.
Namespace
Drupal\locale\TestsCode
protected function addLanguage($langcode) {
$edit = array(
'predefined_langcode' => $langcode,
);
$this
->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
$this->container
->get('language_manager')
->reset();
$this
->assertTrue(\Drupal::languageManager()
->getLanguage($langcode), SafeMarkup::format('Language %langcode added.', array(
'%langcode' => $langcode,
)));
}