You are here

function UserRelationshipsI18nTestCase::addLanguage in User Relationships 7

Sets the proper environment.

Currently just adds a new language.

Parameters

string $langcode: The language code.

1 call to UserRelationshipsI18nTestCase::addLanguage()
UserRelationshipsI18nTestCase::testTypeTranslation in ./user_relationships.test
Test translation of types.

File

./user_relationships.test, line 578
User Relationships API tests @author Alex Karshakevich http://drupal.org/user/183217

Class

UserRelationshipsI18nTestCase
User Relationship type tests.

Code

function addLanguage($langcode) {

  // Add the language.
  $edit = array(
    'langcode' => $langcode,
  );
  $this
    ->drupalPost('admin/config/regional/language/add', $edit, t('Add language'));
  $this
    ->assertText($langcode, t('Language added successfully.'));
  $this
    ->drupalPost('admin/config/regional/language/edit/' . $langcode, array(
    'prefix' => $langcode,
  ), t('Save language'));

  // This is needed to refresh the static cache of the language list.
  drupal_static_reset('language_list');
}