From 0605493217de5cc92aaf5e4de725f37d097bf3a3 Mon Sep 17 00:00:00 2001
From: webchick <webchick@24967.no-reply.drupal.org>
Date: Tue, 7 Jan 2014 21:26:03 -0800
Subject: [PATCH] Issue #2080543 by larowlan, angel.h, grisendo, mrsinguyen:
 Remove unused local variables in the forum module.

---
 core/modules/forum/forum.module               |  3 ---
 .../lib/Drupal/forum/Tests/ForumTest.php      | 20 ++++++-------------
 2 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module
index 9b405b2a7232..2271f56d28ca 100644
--- a/core/modules/forum/forum.module
+++ b/core/modules/forum/forum.module
@@ -6,10 +6,7 @@
  */
 
 use Drupal\Core\Entity\EntityInterface;
-use Drupal\Core\Language\Language;
-use Drupal\taxonomy\Entity\Term;
 use Drupal\field\Field;
-use Drupal\node\NodeInterface;
 
 /**
  * Implements hook_help().
diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
index 6b1fa376b3f7..460b3f902ddc 100644
--- a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
+++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
@@ -118,7 +118,7 @@ function testForum() {
     // Do the admin tests.
     $this->doAdminTests($this->admin_user);
 
-    $this->generateForumTopics($this->forum);
+    $this->generateForumTopics();
 
     // Login an unprivileged user to view the forum topics and generate an
     // active forum topics list.
@@ -140,7 +140,7 @@ function testForum() {
     // Create a forum node authored by this user.
     $own_topics_user_node = $this->createForumTopic($this->forum, FALSE);
     // Verify that this user cannot edit forum content authored by another user.
-    $this->verifyForums($this->edit_any_topics_user, $any_topics_user_node, FALSE, 403);
+    $this->verifyForums($any_topics_user_node, FALSE, 403);
 
     // Verify that this user is shown a local task to add new forum content.
     $this->drupalGet('forum');
@@ -151,7 +151,7 @@ function testForum() {
     // Login a user with permission to edit any forum content.
     $this->drupalLogin($this->edit_any_topics_user);
     // Verify that this user can edit forum content authored by another user.
-    $this->verifyForums($this->edit_own_topics_user, $own_topics_user_node, TRUE);
+    $this->verifyForums($own_topics_user_node, TRUE);
 
     // Verify the topic and post counts on the forum page.
     $this->drupalGet('forum');
@@ -246,9 +246,6 @@ private function doAdminTests($user) {
     // Login the user.
     $this->drupalLogin($user);
 
-    // Retrieve forum menu id.
-    $mlid = db_query_range("SELECT mlid FROM {menu_links} WHERE link_path = 'forum' AND menu_name = 'tools' AND module = 'system' ORDER BY mlid ASC", 0, 1)->fetchField();
-
     // Add forum to the Tools menu.
     $edit = array();
     $this->drupalPostForm('admin/structure/menu/manage/tools', $edit, t('Save'));
@@ -438,7 +435,7 @@ private function doBasicTests($user, $admin) {
     // Create forum node.
     $node = $this->createForumTopic($this->forum, FALSE);
     // Verify the user has access to all the forum nodes.
-    $this->verifyForums($user, $node, $admin);
+    $this->verifyForums($node, $admin);
   }
 
   /**
@@ -522,8 +519,6 @@ function createForumTopic($forum, $container = FALSE) {
   /**
    * Verifies that the logged in user has access to a forum node.
    *
-   * @param $node_user
-   *   The user who creates the node.
    * @param \Drupal\Core\Entity\EntityInterface $node
    *   The node being checked.
    * @param $admin
@@ -531,7 +526,7 @@ function createForumTopic($forum, $container = FALSE) {
    * @param $response
    *   The exptected HTTP response code.
    */
-  private function verifyForums($node_user, EntityInterface $node, $admin, $response = 200) {
+  private function verifyForums(EntityInterface $node, $admin, $response = 200) {
     $response2 = ($admin) ? 200 : 403;
 
     // View forum help node.
@@ -628,11 +623,8 @@ private function verifyForumView($forum, $parent = NULL) {
 
   /**
    * Generates forum topics.
-   *
-   * @param array $forum
-   *   The forum array (a row from taxonomy_term_data table).
    */
-  private function generateForumTopics($forum) {
+  private function generateForumTopics() {
     $this->nids = array();
     for ($i = 0; $i < 5; $i++) {
       $node = $this->createForumTopic($this->forum, FALSE);
-- 
GitLab