You are here

protected function LanguageConfigurationTest::getHighestConfigurableLanguageWeight in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/language/src/Tests/LanguageConfigurationTest.php \Drupal\language\Tests\LanguageConfigurationTest::getHighestConfigurableLanguageWeight()

Helper to get maximum weight of configurable (unlocked) languages.

Return value

int Maximum weight of configurable languages.

2 calls to LanguageConfigurationTest::getHighestConfigurableLanguageWeight()
LanguageConfigurationTest::checkConfigurableLanguageWeight in core/modules/language/src/Tests/LanguageConfigurationTest.php
Validates system languages are ordered after configurable languages.
LanguageConfigurationTest::testLanguageConfigurationWeight in core/modules/language/src/Tests/LanguageConfigurationTest.php
Functional tests for setting system language weight on adding, editing and deleting languages.

File

core/modules/language/src/Tests/LanguageConfigurationTest.php, line 209
Contains \Drupal\language\Tests\LanguageConfigurationTest.

Class

LanguageConfigurationTest
Adds and configures languages to check negotiation changes.

Namespace

Drupal\language\Tests

Code

protected function getHighestConfigurableLanguageWeight() {
  $max_weight = 0;

  /* @var $languages \Drupal\Core\Language\LanguageInterface[] */
  $languages = entity_load_multiple('configurable_language', NULL, TRUE);
  foreach ($languages as $language) {
    if (!$language
      ->isLocked()) {
      $max_weight = max($max_weight, $language
        ->getWeight());
    }
  }
  return $max_weight;
}