Skip to content

Commit c2cdca8

Browse files
akaashakaash
authored andcommitted
ACQE-5019 | Added commenting on the codes
1 parent ca04c5e commit c2cdca8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

dev/tests/integration/testsuite/Magento/Customer/Controller/ForgotPasswordPostTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ private function assertSuccessSessionMessage(string $email): void
200200
*/
201201
public function testResetLinkSentAfterForgotPassword(): void
202202
{
203+
// Getting and asserting actual default expiration period
203204
$defaultExpirationPeriod = 2;
204205
$actualExpirationPeriod = (int) $this->scopeConfig->getValue(
205206
'customer/password/reset_link_expiration_period',
@@ -210,6 +211,7 @@ public function testResetLinkSentAfterForgotPassword(): void
210211
$actualExpirationPeriod
211212
);
212213

214+
// Updating expiration period
213215
$this->resourceConfig->saveConfig(
214216
'customer/password/reset_link_expiration_period',
215217
1,
@@ -222,6 +224,7 @@ public function testResetLinkSentAfterForgotPassword(): void
222224
$this->getRequest()->setPostValue(['email' => $email]);
223225
$this->getRequest()->setMethod(HttpRequest::METHOD_POST);
224226

227+
// Click on the forgot password
225228
$this->dispatch('customer/account/forgotPasswordPost');
226229
$this->assertRedirect($this->stringContains('customer/account/'));
227230
$this->assertSessionMessages(
@@ -247,6 +250,7 @@ public function testResetLinkSentAfterForgotPassword(): void
247250
$token = $customerData->getRpToken();
248251
$customerId = $customerData->getId();
249252

253+
// Asserting mail contains reset link
250254
$this->assertEquals(
251255
1,
252256
Xpath::getElementsCountForXpath(
@@ -296,6 +300,7 @@ public function testResetLinkExpirationByTimeout(): void
296300
$session->setRpToken($token);
297301
$session->setRpCustomerId($customerId);
298302

303+
// Click on the reset password link
299304
$this->getRequest()->setParam('token', $token)->setParam('id', $customerId);
300305
$this->dispatch('customer/account/createPassword');
301306
$this->assertSessionMessages(
@@ -307,6 +312,7 @@ public function testResetLinkExpirationByTimeout(): void
307312
->sub(\DateInterval::createFromDateString('2 hour'))
308313
->format(DateTime::DATETIME_PHP_FORMAT);
309314

315+
// Updating reTokenCreatedAt field
310316
$customerSecure = $customerRegistry->retrieveSecureData($customerId);
311317
$customerSecure->setRpTokenCreatedAt($rpTokenCreatedAt);
312318
$this->customerResource->save($customerData);
@@ -315,6 +321,7 @@ public function testResetLinkExpirationByTimeout(): void
315321
$this->getRequest()->setMethod(HttpRequest::METHOD_GET);
316322
$this->dispatch('customer/account/createPassword');
317323

324+
// Asserting failed message after link expire
318325
$this->assertSessionMessages(
319326
$this->equalTo(['Your password reset link has expired.']),
320327
MessageInterface::TYPE_ERROR

0 commit comments

Comments
 (0)