Skip to content

Commit 02a65d0

Browse files
committed
MAGETWO-93628: Shopping cart is emptied after reset password procedure
1 parent 99abf09 commit 02a65d0

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

app/code/Magento/Customer/Model/AccountManagement.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,10 +1066,7 @@ public function validate(CustomerInterface $customer)
10661066
$result = $this->getEavValidator()->isValid($customerModel);
10671067
if ($result === false && is_array($this->getEavValidator()->getMessages())) {
10681068
return $validationResults->setIsValid(false)->setMessages(
1069-
call_user_func_array(
1070-
'array_merge',
1071-
$this->getEavValidator()->getMessages()
1072-
)
1069+
array_merge(...$this->getEavValidator()->getMessages())
10731070
);
10741071
}
10751072
return $validationResults->setIsValid(true)->setMessages([]);

app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,8 +1238,7 @@ public function testInitiatePasswordResetEmailReminder()
12381238

12391239
$storeId = 1;
12401240

1241-
mt_srand(mt_rand() + (100000000 * (float)microtime()) % PHP_INT_MAX);
1242-
$hash = md5(uniqid(microtime() . mt_rand(0, mt_getrandmax()), true));
1241+
$hash = hash('sha256', microtime() . random_int(PHP_INT_MIN, PHP_INT_MAX));
12431242

12441243
$this->emailNotificationMock->expects($this->once())
12451244
->method('passwordReminder')
@@ -1263,8 +1262,7 @@ public function testInitiatePasswordResetEmailReset()
12631262
$templateIdentifier = 'Template Identifier';
12641263
$sender = 'Sender';
12651264

1266-
mt_srand(mt_rand() + (100000000 * (float)microtime()) % PHP_INT_MAX);
1267-
$hash = md5(uniqid(microtime() . mt_rand(0, mt_getrandmax()), true));
1265+
$hash = hash('sha256', microtime() . random_int(PHP_INT_MIN, PHP_INT_MAX));
12681266

12691267
$this->emailNotificationMock->expects($this->once())
12701268
->method('passwordResetConfirmation')
@@ -1288,8 +1286,7 @@ public function testInitiatePasswordResetNoTemplate()
12881286
$templateIdentifier = 'Template Identifier';
12891287
$sender = 'Sender';
12901288

1291-
mt_srand(mt_rand() + (100000000 * (float)microtime()) % PHP_INT_MAX);
1292-
$hash = md5(uniqid(microtime() . mt_rand(0, mt_getrandmax()), true));
1289+
$hash = hash('sha256', microtime() . random_int(PHP_INT_MIN, PHP_INT_MAX));
12931290

12941291
$this->prepareInitiatePasswordReset($email, $templateIdentifier, $sender, $storeId, $customerId, $hash);
12951292

0 commit comments

Comments
 (0)