@@ -156,7 +156,7 @@ public function testResetPasswordTokenEmptyValue()
156
156
public function testResetPasswordTokenMismatched ()
157
157
{
158
158
$ this ->expectException (\Exception::class);
159
- $ this ->expectExceptionMessage ('Cannot set the customer \' s password ' );
159
+ $ this ->expectExceptionMessage ('The password token is mismatched. Reset and try again ' );
160
160
$ query = <<<QUERY
161
161
mutation {
162
162
resetPassword (
@@ -192,6 +192,52 @@ public function testNewPasswordEmptyValue()
192
192
$ this ->graphQlMutation ($ query );
193
193
}
194
194
195
+ /**
196
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
197
+ *
198
+ * @throws NoSuchEntityException
199
+ * @throws Exception
200
+ * @throws LocalizedException
201
+ */
202
+ public function testNewPasswordCheckMinLength ()
203
+ {
204
+ $ this ->expectException (\Exception::class);
205
+ $ this ->expectExceptionMessage ('The password needs at least 8 characters. Create a new password and try again ' );
206
+ $ query = <<<QUERY
207
+ mutation {
208
+ resetPassword (
209
+ email: " {$ this ->getCustomerEmail ()}"
210
+ resetPasswordToken: " {$ this ->getResetPasswordToken ()}"
211
+ newPassword: "new_"
212
+ )
213
+ }
214
+ QUERY ;
215
+ $ this ->graphQlMutation ($ query );
216
+ }
217
+
218
+ /**
219
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
220
+ *
221
+ * @throws NoSuchEntityException
222
+ * @throws Exception
223
+ * @throws LocalizedException
224
+ */
225
+ public function testNewPasswordCheckCharactersStrength ()
226
+ {
227
+ $ this ->expectException (\Exception::class);
228
+ $ this ->expectExceptionMessage ('Minimum of different classes of characters in password is 3. Classes of characters: Lower Case, Upper Case, Digits, Special Characters. ' );
229
+ $ query = <<<QUERY
230
+ mutation {
231
+ resetPassword (
232
+ email: " {$ this ->getCustomerEmail ()}"
233
+ resetPasswordToken: " {$ this ->getResetPasswordToken ()}"
234
+ newPassword: "new_password"
235
+ )
236
+ }
237
+ QUERY ;
238
+ $ this ->graphQlMutation ($ query );
239
+ }
240
+
195
241
/**
196
242
* Check password reset for lock customer
197
243
*
0 commit comments