commit fa9e798995b88119e4bea697779233620955384a Author: Joel Pittet Date: Mon Jan 11 11:07:33 2016 -0800 second diff --git a/core/modules/user/src/Tests/UserCreateTest.php b/core/modules/user/src/Tests/UserCreateTest.php index 15e17a5..5c4243c 100644 --- a/core/modules/user/src/Tests/UserCreateTest.php +++ b/core/modules/user/src/Tests/UserCreateTest.php @@ -120,8 +120,7 @@ public function testUserAdd() { $edit = array( 'name' => $name, 'mail' => $this->randomMachineName() . '@example.com', - 'pass[pass1]' => 0, - 'pass[pass2]' => 0, + 'pass' => 0, 'notify' => FALSE, ); $this->drupalPostForm('admin/people/create', $edit, t('Create new account')); diff --git a/core/modules/user/src/Tests/UserEditTest.php b/core/modules/user/src/Tests/UserEditTest.php index c050992..7d4d263 100644 --- a/core/modules/user/src/Tests/UserEditTest.php +++ b/core/modules/user/src/Tests/UserEditTest.php @@ -108,7 +108,7 @@ public function testUserWith0Password() { // Create a regular user. $user1 = $this->drupalCreateUser([]); - $edit = ['pass[pass1]' => '0', 'pass[pass2]' => '0']; + $edit = ['pass' => '0']; $this->drupalPostForm("user/" . $user1->id() . "/edit", $edit, t('Save')); $this->assertRaw(t("The changes have been saved.")); } diff --git a/core/modules/user/src/Tests/UserPasswordResetTest.php b/core/modules/user/src/Tests/UserPasswordResetTest.php index 7e5d9d9..050533d 100644 --- a/core/modules/user/src/Tests/UserPasswordResetTest.php +++ b/core/modules/user/src/Tests/UserPasswordResetTest.php @@ -119,7 +119,7 @@ function testUserPasswordReset() { // Change the forgotten password. $password = user_password(); - $edit = array('pass' => $password); + $edit = ['pass' => $password]; $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertText(t('The changes have been saved.'), 'Forgotten password changed.'); @@ -205,7 +205,7 @@ public function testUserPasswordResetLoggedIn() { // Change the password. $password = user_password(); - $edit = array('pass[pass1]' => $password, 'pass[pass2]' => $password); + $edit = ['pass' => $password]; $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertText(t('The changes have been saved.'), 'Password changed.'); } diff --git a/core/modules/user/src/Tests/UserRegistrationTest.php b/core/modules/user/src/Tests/UserRegistrationTest.php index 71e1094..b7ca830 100644 --- a/core/modules/user/src/Tests/UserRegistrationTest.php +++ b/core/modules/user/src/Tests/UserRegistrationTest.php @@ -193,7 +193,7 @@ public function testUuidFormState() { $edit = []; $edit['name'] = $this->randomMachineName(); $edit['mail'] = $edit['name'] . '@example.com'; - $edit['pass[pass2]'] = $edit['pass[pass1]'] = $this->randomMachineName(); + $edit['pass'] = $this->randomMachineName(); // Create one account. $this->drupalPostForm('user/register', $edit, t('Create new account')); @@ -207,7 +207,7 @@ public function testUuidFormState() { // Create a second account. $edit['name'] = $this->randomMachineName(); $edit['mail'] = $edit['name'] . '@example.com'; - $edit['pass[pass2]'] = $edit['pass[pass1]'] = $this->randomMachineName(); + $edit['pass'] = $this->randomMachineName(); $this->drupalPostForm('user/register', $edit, t('Create new account')); $this->assertResponse(200); diff --git a/core/tests/Drupal/Tests/Core/Render/Element/PasswordConfirmTest.php b/core/tests/Drupal/Tests/Core/Render/Element/PasswordConfirmTest.php deleted file mode 100644 index 7f1e186..0000000 --- a/core/tests/Drupal/Tests/Core/Render/Element/PasswordConfirmTest.php +++ /dev/null @@ -1,45 +0,0 @@ -prophesize(FormStateInterface::class)->reveal(); - $this->assertSame($expected, PasswordConfirm::valueCallback($element, $input, $form_state)); - } - - /** - * Data provider for testValueCallback(). - */ - public function providerTestValueCallback() { - $data = []; - $data[] = [['pass1' => '', 'pass2' => ''], [], NULL]; - $data[] = [['pass1' => '', 'pass2' => ''], ['#default_value' => ['pass2' => 'value']], NULL]; - $data[] = [['pass2' => 'value', 'pass1' => ''], ['#default_value' => ['pass2' => 'value']], FALSE]; - $data[] = [['pass1' => '123456', 'pass2' => 'qwerty'], [], ['pass1' => '123456', 'pass2' => 'qwerty']]; - $data[] = [['pass1' => '123', 'pass2' => '234'], [], ['pass1' => 123, 'pass2' => 234]]; - $data[] = [['pass1' => '', 'pass2' => '234'], [], ['pass1' => ['array'], 'pass2' => 234]]; - - return $data; - } - -}