Part of meta-issue #2002650: [meta, no patch] improve maintainability by removing unused local variables

File /core/modules/field/lib/Drupal/field/Tests/Views/HandlerFieldFieldTest.php

Line 87: Unused local variable $key
Line 158: Unused local variable $rendered_field

Comments

haza’s picture

Status: Active » Needs review
StatusFileSize
new1.27 KB
longwave’s picture

-    // Test that an empty field is rendered without error.
-    $rendered_field = $view->style_plugin->getField(4, $this->fields[4]['field_name']);

This seems like it is testing something, even if there is no assertion.

g.i.joe’s picture

Status: Needs review » Needs work
+++ b/core/modules/field/lib/Drupal/field/Tests/Views/HandlerFieldFieldTest.php
@@ -164,9 +164,6 @@ public function _testMultipleFieldRender() {
-    // Test that an empty field is rendered without error.
-    $rendered_field = $view->style_plugin->getField(4, $this->fields[4]['field_name']);
-

just remove the variable and leave the function intact because we don't know the field could be rendered without error.

mcrittenden’s picture

Status: Needs work » Needs review
StatusFileSize
new1.19 KB
areke’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs reroll

The patch no longer applies.

royal121’s picture

Assigned: Unassigned » royal121
Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new1.14 KB

Added a new patch.

longwave’s picture

Status: Needs review » Reviewed & tested by the community
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.