@@ -121,14 +121,31 @@ public function testChangePasswordIfCurrentPasswordIsEmpty()
121
121
$ customerEmail =
'[email protected] ' ;
122
122
$ oldCustomerPassword = 'password ' ;
123
123
$ newCustomerPassword = 'anotherPassword1 ' ;
124
- $ incorrectPassword = '' ;
124
+ $ currentCustomerPassword = '' ;
125
125
126
- $ query = $ this ->getChangePassQuery ($ incorrectPassword , $ newCustomerPassword );
126
+ $ query = $ this ->getChangePassQuery ($ currentCustomerPassword , $ newCustomerPassword );
127
127
128
128
$ headerMap = $ this ->getCustomerAuthHeaders ($ customerEmail , $ oldCustomerPassword );
129
129
$ this ->graphQlMutation ($ query , [], '' , $ headerMap );
130
130
}
131
131
132
+ /**
133
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
134
+ * @expectedException \Exception
135
+ * @expectedExceptionMessage Specify the "newPassword" value.
136
+ */
137
+ public function testChangePasswordIfNewPasswordIsEmpty ()
138
+ {
139
+ $ customerEmail =
'[email protected] ' ;
140
+ $ currentCustomerPassword = 'password ' ;
141
+ $ newCustomerPassword = '' ;
142
+
143
+ $ query = $ this ->getChangePassQuery ($ currentCustomerPassword , $ newCustomerPassword );
144
+
145
+ $ headerMap = $ this ->getCustomerAuthHeaders ($ customerEmail , $ currentCustomerPassword );
146
+ $ this ->graphQlMutation ($ query , [], '' , $ headerMap );
147
+ }
148
+
132
149
private function getChangePassQuery ($ currentPassword , $ newPassword )
133
150
{
134
151
$ query = <<<QUERY
0 commit comments