class LanguageTestManager

Defines a LanguageManager service to test URL negotiation.

Hierarchy

Expanded class hierarchy of LanguageTestManager

File

drupal/core/modules/language/tests/language_test/lib/Drupal/language_test/LanguageTestManager.php, line 16
Contains \Drupal\language_test\LanguageTestManager.

Namespace

Drupal\language_test
View source
class LanguageTestManager extends LanguageManager {

  /**
   * Overrides \Drupal\Core\Language\LanguageManager::init().
   */
  public function init() {
    if ($test_domain = \Drupal::state()
      ->get('language_test.domain')) {
      $_SERVER['HTTP_HOST'] = $test_domain;
    }
    return parent::init();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
LanguageManager::$initialized protected property Whether or not the language manager has been initialized.
LanguageManager::$initializing protected property Whether already in the process of language initialization.
LanguageManager::$languages protected property An array of language objects keyed by language type.
LanguageManager::$request protected property A request object.
LanguageManager::getLanguage public function Returns a language object for the given type.
LanguageManager::getLanguageDefault protected function Returns a language object representing the site's default language.
LanguageManager::getLanguageTypes protected function Returns an array of the available language types.
LanguageManager::getStandardLanguageList public static function Some common languages with their English and native names.
LanguageManager::isMultilingual public function Returns whether or not the site has more than one language enabled.
LanguageManager::reset public function Resets the given language type or all types if none specified.
LanguageManager::setRequest public function Sets the $request property and resets all language types.
LanguageTestManager::init public function Overrides \Drupal\Core\Language\LanguageManager::init(). Overrides LanguageManager::init