You are here

public function LanguageHierarchyBaseTestCase::getLanguage in Language Hierarchy 7

Get a language object from a language code.

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

File

tests/language_hierarchy.test, line 49
Tests for Language Hierarchy module.

Class

LanguageHierarchyBaseTestCase
Base class for Language Hierarchy module tests.

Code

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