From 72a600a1981f69ca22458d20856f691ecb026115 Mon Sep 17 00:00:00 2001
From: Nathaniel Catchpole <catch@35733.no-reply.drupal.org>
Date: Tue, 3 Dec 2013 13:36:13 +0000
Subject: [PATCH] Issue #2080527 by chertzog: Remove Unused local variable
 $base_url from
 /core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php.

---
 .../lib/Drupal/locale/PoDatabaseWriter.php    |  3 +--
 .../Drupal/locale/Tests/LocaleContentTest.php |  2 --
 .../Tests/LocaleImportFunctionalTest.php      |  2 +-
 .../Drupal/locale/Tests/LocalePathTest.php    |  2 --
 .../Drupal/locale/Tests/LocaleStringTest.php  |  4 ++--
 .../locale/Tests/LocaleTranslationUiTest.php  | 22 ++++---------------
 .../Drupal/locale/Tests/LocaleUpdateTest.php  |  2 +-
 7 files changed, 9 insertions(+), 28 deletions(-)

diff --git a/core/modules/locale/lib/Drupal/locale/PoDatabaseWriter.php b/core/modules/locale/lib/Drupal/locale/PoDatabaseWriter.php
index d5a12256629b..cdcb0c06aef0 100644
--- a/core/modules/locale/lib/Drupal/locale/PoDatabaseWriter.php
+++ b/core/modules/locale/lib/Drupal/locale/PoDatabaseWriter.php
@@ -155,7 +155,6 @@ function getHeader() {
    */
   function setHeader(PoHeader $header) {
     $this->_header = $header;
-    $config = \Drupal::config('locale.settings');
     $locale_plurals = \Drupal::state()->get('locale.translation.plurals') ?: array();
 
     // Check for options.
@@ -267,7 +266,7 @@ private function importString(PoItem $item) {
         // No such source string in the database yet.
         $string = \Drupal::service('locale.storage')->createString(array('source' => $source, 'context' => $context))
           ->save();
-        $target = \Drupal::service('locale.storage')->createTranslation(array(
+        \Drupal::service('locale.storage')->createTranslation(array(
           'lid' => $string->getId(),
           'language' => $this->_langcode,
           'translation' => $translation,
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php
index 2b53ff393087..87febe49f262 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php
@@ -63,8 +63,6 @@ function testMachineNameLTR() {
    * Test if a content type can be set to multilingual and language is present.
    */
   function testContentTypeLanguageConfiguration() {
-    global $base_url;
-
     $type1 = $this->drupalCreateContentType();
     $type2 = $this->drupalCreateContentType();
 
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php
index 8cd217b35860..13b7bc2a8885 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php
@@ -53,7 +53,7 @@ function testStandalonePoFile() {
     $this->importPoFile($this->getPoFile(), array(
       'langcode' => 'fr',
     ));
-    $config = \Drupal::config('locale.settings');
+    \Drupal::config('locale.settings');
     // The import should automatically create the corresponding language.
     $this->assertRaw(t('The language %language has been created.', array('%language' => 'French')), 'The language has been automatically created.');
 
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php
index 931212d5c984..62aba310e380 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php
@@ -41,8 +41,6 @@ function setUp() {
    * Test if a language can be associated with a path alias.
    */
   function testPathLanguageConfiguration() {
-    global $base_url;
-
     // User to add and remove language.
     $admin_user = $this->drupalCreateUser(array('administer languages', 'create page content', 'administer url aliases', 'create url aliases', 'access administration pages'));
 
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleStringTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleStringTest.php
index 2a59408d64b2..59993f03b2de 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleStringTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleStringTest.php
@@ -96,7 +96,7 @@ function testStringCRUDAPI() {
 
     // Create some translations and then delete string and all of its translations.
     $lid = $source->lid;
-    $translations = $this->createAllTranslations($source);
+    $this->createAllTranslations($source);
     $search = $this->storage->getTranslations(array('lid' => $source->lid));
     $this->assertEqual(count($search), 3, 'Created and retrieved all translations for our source string.');
 
@@ -144,7 +144,7 @@ function testStringSearchAPI() {
     // Not customized translations.
     $translate1 = $this->createAllTranslations($source1);
     // Customized translations.
-    $translate2 = $this->createAllTranslations($source2, array('customized' => LOCALE_CUSTOMIZED));
+    $this->createAllTranslations($source2, array('customized' => LOCALE_CUSTOMIZED));
     // Try quick search function with different field combinations.
     $langcode = 'es';
     $found = $this->storage->findTranslation(array('language' => $langcode, 'source' => $source1->source, 'context' => $source1->context));
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationUiTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationUiTest.php
index 06b6ed42ec00..d02f76388c25 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationUiTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationUiTest.php
@@ -46,8 +46,6 @@ function testEnglishTranslation() {
    * Adds a language and tests string translation by users with the appropriate permissions.
    */
   function testStringTranslation() {
-    global $base_url;
-
     // User to add and remove language.
     $admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages'));
     // User to translate and delete string.
@@ -56,9 +54,6 @@ function testStringTranslation() {
     $langcode = 'xx';
     // The English name for the language. This will be translated.
     $name = $this->randomName(16);
-    // This is the language indicator on the translation search screen for
-    // untranslated strings.
-    $language_indicator = "<em class=\"locale-untranslated\">$langcode</em> ";
     // This will be the translation of $name.
     $translation = $this->randomName(16);
     $translation_to_en = $this->randomName(16);
@@ -94,9 +89,7 @@ function testStringTranslation() {
     // We save the lid from the path.
     $textarea = current($this->xpath('//textarea'));
     $lid = (string) $textarea[0]['name'];
-    $edit = array(
-      $lid => $this->randomName(),
-    );
+
     // No t() here, it's surely not translated yet.
     $this->assertText($name, 'name found on edit screen.');
     $this->assertNoOption('edit-langcode', 'en', 'No way to translate the string to English.');
@@ -276,8 +269,6 @@ function testJavaScriptTranslation() {
    * Tests the validation of the translation input.
    */
   function testStringValidation() {
-    global $base_url;
-
     // User to add language and strings.
     $admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages', 'translate interface'));
     $this->drupalLogin($admin_user);
@@ -316,7 +307,7 @@ function testStringValidation() {
 
     $textarea = current($this->xpath('//textarea'));
     $lid = (string) $textarea[0]['name'];
-    foreach ($bad_translations as $key => $translation) {
+    foreach ($bad_translations as $translation) {
       $edit = array(
         $lid => $translation,
       );
@@ -332,8 +323,6 @@ function testStringValidation() {
    * Tests translation search form.
    */
   function testStringSearch() {
-    global $base_url;
-
     // User to add and remove language.
     $admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages'));
     // User to translate and delete string.
@@ -343,9 +332,6 @@ function testStringSearch() {
     $langcode = 'xx';
     // The English name for the language. This will be translated.
     $name = $this->randomName(16);
-    // This is the language indicator on the translation search screen for
-    // untranslated strings.
-    $language_indicator = "<em class=\"locale-untranslated\">$langcode</em> ";
     // This will be the translation of $name.
     $translation = $this->randomName(16);
 
@@ -510,7 +496,7 @@ function testUICustomizedStrings(){
     );
     $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
 
-    $source = $this->assertText($translation->getString(), 'Translation is found in search result.');
+    $this->assertText($translation->getString(), 'Translation is found in search result.');
 
     // Submit the translations without changing the translation.
     $textarea = current($this->xpath('//textarea'));
@@ -528,7 +514,7 @@ function testUICustomizedStrings(){
       'customized' => '0',
     );
     $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
-    $source = $this->assertText($string->getString(), 'Translation is not marked as customized.');
+    $this->assertText($string->getString(), 'Translation is not marked as customized.');
 
     // Submit the translations with a new translation.
     $textarea = current($this->xpath('//textarea'));
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php
index 3d20f6d165cb..62fa90c48eef 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php
@@ -65,7 +65,7 @@ function testUpdateProjects() {
    */
   function testUpdateProjectsHidden() {
     module_load_include('compare.inc', 'locale');
-    $config = \Drupal::config('locale.settings');
+    \Drupal::config('locale.settings');
 
     // Make the test modules look like a normal custom module.
     \Drupal::state()->set('locale.test_system_info_alter', TRUE);
-- 
GitLab