You are here

public function Drupali18nTestCase::getLanguage in Internationalization 6

Same name and namespace in other branches
  1. 7 i18n.test \Drupali18nTestCase::getLanguage()

Get language object for langcode

2 calls to Drupali18nTestCase::getLanguage()
Drupali18nTestCase::i18nGet in tests/drupal_i18n_test_case.php
Retrieves a Drupal path or an absolute path with language
Drupali18nTestCase::switchLanguage in tests/drupal_i18n_test_case.php
Switch global language

File

tests/drupal_i18n_test_case.php, line 183

Class

Drupali18nTestCase
Test case for typical Drupal tests.

Code

public function getLanguage($langcode) {
  if (is_object($langcode)) {
    return $langcode;
  }
  else {
    $language_list = language_list();
    return $language_list[$langcode];
  }
}