Commit 43324d17 authored by alexpott's avatar alexpott

Issue #2080427 by connork, blainelang, harijari, areke, chertzog: Remove...

Issue #2080427 by connork, blainelang, harijari, areke, chertzog: Remove Unused local variables from language module.
parent 978b47c7
......@@ -319,7 +319,7 @@ public function updateLockedLanguageWeights() {
// Loop locked languages to maintain the existing order.
$locked_languages = $this->getLanguages(Language::STATE_LOCKED);
$config_ids = array_map(function($language) { return 'language.entity.' . $language->id; }, $locked_languages);
foreach ($this->configFactory->loadMultiple($config_ids) as $config_id => $config) {
foreach ($this->configFactory->loadMultiple($config_ids) as $config) {
// Update system languages weight.
$max_weight++;
$config->set('weight', $max_weight);
......
......@@ -35,7 +35,6 @@ public function getLangcode(Request $request = NULL) {
$langcode = NULL;
if ($this->languageManager) {
$languages = $this->languageManager->getLanguages();
$langcode = $this->config->get('language.negotiation')->get('selected_langcode');
}
......
......@@ -34,7 +34,6 @@ public static function getInfo() {
* Functional tests for adding, editing and deleting languages.
*/
function testLanguageConfiguration() {
global $base_url;
// User to add and remove language.
$admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages', 'administer site configuration'));
......
......@@ -34,7 +34,6 @@ public static function getInfo() {
* Functional tests for adding, editing and deleting languages.
*/
public function testLanguageConfiguration() {
global $base_url;
// Create user with permissions to add and remove languages.
$admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages'));
......
......@@ -34,7 +34,6 @@ public static function getInfo() {
* Functional tests for adding, editing and deleting languages.
*/
function testLanguageList() {
global $base_url;
// User to add and remove language.
$admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages', 'administer site configuration'));
......@@ -118,12 +117,9 @@ function testLanguageList() {
$this->assertResponse(404, 'Language no longer found.');
// Make sure the "language_count" state has been updated correctly.
$this->container->get('language_manager')->reset();
$languages = $this->container->get('language_manager')->getLanguages();
// Delete French.
$this->drupalPostForm('admin/config/regional/language/delete/fr', array(), t('Delete'));
// Get the count of languages.
$this->container->get('language_manager')->reset();
$languages = $this->container->get('language_manager')->getLanguages();
// We need raw here because %language and %langcode will add HTML.
$t_args = array('%language' => 'French', '%langcode' => 'fr');
$this->assertRaw(t('The %language (%langcode) language has been removed.', $t_args), 'The French language has been removed.');
......
......@@ -240,7 +240,6 @@ protected function doTestLanguageLinkActiveClassAuthenticated() {
*/
protected function doTestLanguageLinkActiveClassAnonymous() {
$function_name = '#type link';
$path = 'language_test/type-link-active-class';
$this->drupalLogout();
......
......@@ -90,9 +90,6 @@ function testUILanguageNegotiation() {
// For setting browser language preference to some unknown.
$http_header_blah = array("Accept-Language: blah;q=1");
// This domain should switch the UI to Chinese.
$language_domain = 'example.cn';
// Setup the site languages by installing two languages.
// Set the default language in order for the translated string to be registered
// into database when seen by t(). Without doing this, our target string
......
......@@ -58,7 +58,6 @@ function testUrlRewritingEdgeCases() {
$non_existing->id = $this->randomName();
$this->checkUrl($non_existing, 'Path language is ignored if language is not installed.', 'URL language negotiation does not work with non-installed languages');
$request = $this->prepareRequestForGenerator();
// Check that URL rewriting is not applied to subrequests.
$this->drupalGet('language_test/subrequest');
$this->assertText($this->web_user->getUsername(), 'Page correctly retrieved');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment