Views FieldPluginBaseTest has methods with unused arguments

Created on 12 November 2021, almost 3 years ago
Updated 25 January 2024, 8 months ago

Problem/Motivation

In the parent issue we touched a bit of code that seems weird.

core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php has multiple places where the construct:

$final_html = isset($final_html) ? $final_html : $link_html;

or

$final_html = $final_html ?? $link_html;

Is used. This seems to make no sense if you look at the data provider because $link_html is never used outside setting this. We need to investigate what and why this is imo.

FieldPluginBaseTest::testRenderAsLinkWithPathAndOptions

and

FieldPluginBaseTest::testRenderAsLinkWithUrlAndOptions

Proposed Fix

Remove the $link_html parameter and just use $final_html directly for all test cases

Investigation: See for example https://www.drupal.org/project/drupal/issues/2404603#comment-9576291 β†’ the test in an earlier for, where the two parameters made sense (the contained different things)
Conclusion: leftover code from previous iterations of the test

πŸ“Œ Task
Status

Fixed

Version

10.2 ✨

Component
ViewsΒ  β†’

Last updated about 12 hours ago

Created by

πŸ‡³πŸ‡±Netherlands bbrala Netherlands

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024