Verified Commit 72330ced authored by Jess's avatar Jess
Browse files

Revert "Issue #3137119 by munish.kumar, johnwebdev, Jaypan, jungle, xjm,...

Revert "Issue #3137119 by munish.kumar, johnwebdev, Jaypan, jungle, xjm, catch: User::setExistingPassword() does not return $this for chaining"

This reverts commit 6764848b.
parent 6764848b
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -398,7 +398,6 @@ public function setUsername($username) {
   */
  public function setExistingPassword($password) {
    $this->get('pass')->existing = $password;
    return $this;
  }

  /**
+0 −12
Original line number Diff line number Diff line
@@ -91,16 +91,4 @@ public function testUserValidation() {
    $this->assertFalse((bool) $violations->count());
  }

  /**
   * Tests that ::existingPassword can be used for chaining.
   */
  public function testChainExistingPasswordMethod() {
    /** @var \Drupal\user\Entity\User $user */
    $user = User::create([
      'name' => $this->randomMachineName(),
    ]);
    $user = $user->setExistingPassword('existing_pass');
    $this->assertInstanceOf(User::class, $user);
  }

}