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

File /core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php

Line 88: Unused local variable $new_user

Comments

mrsinguyen’s picture

Status: Active » Needs review
StatusFileSize
new839 bytes
sandergo90’s picture

Status: Needs review » Reviewed & tested by the community

The patch successfully applied and looks fine. The variable is now gone and everything passes the testing framework.

Drupal coding standards are applied.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Patch no longer applies.

mrsinguyen’s picture

Status: Needs work » Needs review
StatusFileSize
new843 bytes
dawehner’s picture

Status: Needs review » Needs work
+++ b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php
@@ -85,7 +85,6 @@ function testRegistrationWithoutEmailVerification() {
     $accounts = entity_load_multiple_by_properties('user', array('name' => $name, 'mail' => $mail));
-    $new_user = reset($accounts);

We should probably check that the user is created instead of removing the variable

mcrittenden’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new865 bytes

Using the recommendation in #5.

parthipanramesh’s picture

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

Looks good to me!

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.