Skip to content

Commit 79b5e53

Browse files
akaashakaash
authored andcommitted
PR Feedback
1 parent 372b2d9 commit 79b5e53

File tree

1 file changed

+4
-27
lines changed

1 file changed

+4
-27
lines changed

dev/tests/integration/testsuite/Magento/User/Controller/Adminhtml/UserResetPasswordEmailTest.php

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -118,37 +118,14 @@ public function testAdminEmailNotificationAfterPasswordChange() :void
118118
$adminUser->setPassword('newPassword123');
119119
$adminUser->save();
120120

121-
// Verify email notification was sent
122-
$this->assertEmailNotificationSent($adminEmail);
123-
}
124-
125-
/**
126-
* Assert that an email notification was sent to the specified email address
127-
*
128-
* @param string $emailAddress
129-
* @throws LocalizedException
130-
* @return void
131-
*/
132-
private function assertEmailNotificationSent(string $emailAddress) :void
133-
{
134121
$message = $this->messageFactory->create();
135-
136-
$message->setFrom(['[email protected]' => 'Magento Store']);
137-
$message->addTo($emailAddress);
138-
139-
$subject = 'Your password has been changed';
140-
$message->setSubject($subject);
141-
142-
$body = 'Your password has been changed successfully.';
143-
$message->setBody($body);
122+
$message->addTo($adminEmail);
123+
$message->setSubject('Your password has been changed');
144124

145125
$transport = $this->transportFactory->create(['message' => $message]);
146126
$transport->sendMessage();
147127

148-
$sentMessage = $transport->getMessage();
149-
$this->assertInstanceOf(\Magento\Framework\Mail\MessageInterface::class, $sentMessage);
150-
$this->assertNotNull($sentMessage);
151-
$this->assertEquals($subject, $sentMessage->getSubject());
152-
$this->assertStringContainsString($body, $sentMessage->getBody()->getParts()[0]->getRawContent());
128+
$this->assertInstanceOf(\Magento\Framework\Mail\MessageInterface::class, $transport->getMessage());
129+
$this->assertNotNull($transport->getMessage());
153130
}
154131
}

0 commit comments

Comments
 (0)