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

File /core/modules/system/lib/Drupal/system/Tests/Database/DeleteTruncateTest.php

Line 71: Unused local variable $num_records_before

Comments

chertzog’s picture

Status: Active » Closed (duplicate)
angel.h’s picture

Status: Closed (duplicate) » Active
angel.h’s picture

This issue shouldn't have been closed - see https://drupal.org/node/2080311#comment-7909573.

mcrittenden’s picture

Status: Active » Needs review
StatusFileSize
new713 bytes

This one just removes that line altogether since it's not being used anywhere.

enhdless’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Patch works great.

webchick’s picture

Status: Reviewed & tested by the community » Needs work

Hm. I don't think this is quite right, since it changes the nature of the test. Seems like we should instead add an assertion that makes use of $num_records_before.

Enxebre’s picture

Status: Needs work » Needs review
StatusFileSize
new669 bytes

Adding assertion checking $num_records_before is greater than 0

areke’s picture

Status: Needs review » Reviewed & tested by the community

The patch applies and looks good to me.

xjm’s picture

Status: Reviewed & tested by the community » Closed (duplicate)
Related issues: +#2080343: Remove Unused local variables from system module
xjm’s picture

Title: Remove Unused local variable $num_records_before from lib/Drupal/system/Tests/Database/DeleteTruncateTest.php » Add assertion to Drupal/system/Tests/Database/DeleteTruncateTest.php
Component: other » database system
Status: Closed (duplicate) » Reviewed & tested by the community

Reopening and retitling to reflect what the patch is doing. Thanks!

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.