LocaleLanguageNegotiationInfoFunctionalTest::checkFixedLanguageTypes

7 locale.test private LocaleLanguageNegotiationInfoFunctionalTest::checkFixedLanguageTypes()
8 locale.test protected LocaleLanguageNegotiationInfoFunctionalTest::checkFixedLanguageTypes()

Check that language negotiation for fixed types matches the stored one.

File

modules/locale/locale.test, line 3005
Tests for locale.module.

Code

private function checkFixedLanguageTypes() {
  drupal_static_reset('language_types_info');
  foreach (language_types_info() as $type => $info) {
    if (isset($info['fixed'])) {
      $negotiation = variable_get("language_negotiation_$type", array());
      $equal = count($info['fixed']) == count($negotiation);
      while ($equal && list($id) = each($negotiation)) {
        list(, $info_id) = each($info['fixed']);
        $equal = $info_id == $id;
      }
      $this->assertTrue($equal, t('language negotiation for %type is properly set up', array('%type' => $type)));
    }
  }
}
Login or register to post comments