You are here

public function EntityTranslationTestCase::getLanguage in Entity Translation 7

Get a language object from a language code.

2 calls to EntityTranslationTestCase::getLanguage()
EntityTranslationTestCase::get in tests/entity_translation.test
Retrieves a Drupal path or an absolute path with language.
EntityTranslationTestCase::post in tests/entity_translation.test
Posts to a Drupal path with language.

File

tests/entity_translation.test, line 129
Tests for Entity translation module.

Class

EntityTranslationTestCase
Base class for entity translation module tests.

Code

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