Skip to content

Commit

Permalink
MAGETWO-93628: Shopping cart is emptied after reset password procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
dhorytskyi committed Apr 8, 2019
1 parent 99abf09 commit 02a65d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
5 changes: 1 addition & 4 deletions app/code/Magento/Customer/Model/AccountManagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -1066,10 +1066,7 @@ public function validate(CustomerInterface $customer)
$result = $this->getEavValidator()->isValid($customerModel);
if ($result === false && is_array($this->getEavValidator()->getMessages())) {
return $validationResults->setIsValid(false)->setMessages(
call_user_func_array(
'array_merge',
$this->getEavValidator()->getMessages()
)
array_merge(...$this->getEavValidator()->getMessages())
);
}
return $validationResults->setIsValid(true)->setMessages([]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1238,8 +1238,7 @@ public function testInitiatePasswordResetEmailReminder()

$storeId = 1;

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

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

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

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

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

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

Expand Down

0 comments on commit 02a65d0

Please sign in to comment.