You are here

protected function L10nUpdateTestBase::addLanguage in Localization update 7.2

Adds a language.

Parameters

string $langcode: The language code of the language to add.

4 calls to L10nUpdateTestBase::addLanguage()
L10nUpdateCronTest::setUp in tests/L10nUpdateCronTest.test
Sets up a Drupal site for running functional and integration tests.
L10nUpdateInterfaceTest::testInterface in tests/L10nUpdateInterfaceTest.test
Tests the user interfaces of the interface translation update system.
L10nUpdateTest::setUp in tests/L10nUpdateTest.test
Sets up a Drupal site for running functional and integration tests.
L10nUpdateTest::testEnableLanguage in tests/L10nUpdateTest.test
Tests automatic translation import when a langauge is enabled.

File

tests/L10nUpdateTestBase.test, line 65
Contains L10nUpdateTest.

Class

L10nUpdateTestBase
Tests for update translations.

Code

protected function addLanguage($langcode) {
  $edit = array(
    'langcode' => $langcode,
  );
  $this
    ->drupalPost('admin/config/regional/language/add', $edit, t('Add language'));
  drupal_static_reset('language_list');
  $languages = language_list();
  $this
    ->assertTrue(isset($languages[$langcode]), format_string('Language %langcode added.', array(
    '%langcode' => $langcode,
  )));
}