Problem/Motivation

In core/modules/comment/tests/src/Functional/CommentBlockTest.php, $block variable never used.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

shetpooja04 created an issue. See original summary.

shetpooja04’s picture

Assigned: shetpooja04 » Unassigned
Status: Active » Needs review
FileSize
776 bytes

Please Review

longwave’s picture

Status: Needs review » Needs work

As discussed in the parent issue we need to find out why this variable is left unused before this can be committed.

A useful tool for this is git log -S “SOME TEXT” which will search git commits for matching text to find out when the variable might have become unused. Without doing the work to show why the variable is unused the patch will not be committed. Also git blame can be useful as well.

shetpooja04’s picture

FileSize
565.71 KB

Commit ID: 4462e204 Link: https://git.drupalcode.org/project/drupal/-/commit/4462e2046f389ccce499cfa54d644575488b40fa

File: core/modules/comment/lib/Drupal/comment/Tests/CommentBlockTest.php

Earlier the $block variable were used to fetch its label (Line 64 in screenshot)
It is no longer being used now

shetpooja04’s picture

Status: Needs work » Needs review
longwave’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for researching this, I agree with your findings that we don't need this variable as it was only used to retrieve the block label and that is now hard coded.

  • catch committed 74ae4bd on 9.1.x
    Issue #3163685 by shetpooja04, longwave: Unused variable $block in...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 74ae4bd and pushed to 9.1.x. Thanks!

Status: Fixed » Closed (fixed)

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