@@ -118,37 +118,14 @@ public function testAdminEmailNotificationAfterPasswordChange() :void
118
118
$ adminUser ->setPassword ('newPassword123 ' );
119
119
$ adminUser ->save ();
120
120
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
- {
134
121
$ 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 ' );
144
124
145
125
$ transport = $ this ->transportFactory ->create (['message ' => $ message ]);
146
126
$ transport ->sendMessage ();
147
127
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 ());
153
130
}
154
131
}
0 commit comments