File tree 1 file changed +35
-0
lines changed
dev/tests/api-functional/testsuite/Magento/GraphQl/Customer
1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -234,6 +234,41 @@ public function testCreateCustomerIfPassedAttributeDosNotExistsInCustomerInput()
234
234
}
235
235
}
236
236
}
237
+ QUERY ;
238
+ $ this ->graphQlQuery ($ query );
239
+ }
240
+
241
+ /**
242
+ * @expectedException \Exception
243
+ * @expectedExceptionMessage Required parameters are missing: firstname
244
+ */
245
+ public function testCreateCustomerIfNameEmpty ()
246
+ {
247
+ $ newEmail = 'customer_created ' . rand (1 , 2000000 ) . '@example.com ' ;
248
+ $ newFirstname = '' ;
249
+ $ newLastname = 'Rowe ' ;
250
+ $ currentPassword = 'test123# ' ;
251
+
252
+ $ query = <<<QUERY
253
+ mutation {
254
+ createCustomer(
255
+ input: {
256
+ email: " {$ newEmail }"
257
+ firstname: " {$ newFirstname }"
258
+ lastname: " {$ newLastname }"
259
+ password: " {$ currentPassword }"
260
+ is_subscribed: true
261
+ }
262
+ ) {
263
+ customer {
264
+ id
265
+ firstname
266
+ lastname
267
+ email
268
+ is_subscribed
269
+ }
270
+ }
271
+ }
237
272
QUERY ;
238
273
$ this ->graphQlQuery ($ query );
239
274
}
You can’t perform that action at this time.
0 commit comments