File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
dev/tests/api-functional/testsuite/Magento/GraphQl/Customer Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -308,6 +308,39 @@ public function testCreateCustomerSubscribed()
308
308
$ this ->assertEquals (false , $ response ['createCustomer ' ]['customer ' ]['is_subscribed ' ]);
309
309
}
310
310
311
+ /**
312
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
313
+ * @expectedException \Exception
314
+ * @expectedExceptionMessage A customer with the same email address already exists in an associated website.
315
+ */
316
+ public function testCreateCustomerIfCustomerWithProvidedEmailAlreadyExists ()
317
+ {
318
+ $ existedEmail = 'customer@example.com ' ;
319
+ $ password = 'test123# ' ;
320
+ $ firstname = 'John ' ;
321
+ $ lastname = 'Smith ' ;
322
+
323
+ $ query = <<<QUERY
324
+ mutation {
325
+ createCustomer(
326
+ input: {
327
+ email: " {$ existedEmail }"
328
+ password: " {$ password }"
329
+ firstname: " {$ firstname }"
330
+ lastname: " {$ lastname }"
331
+ }
332
+ ) {
333
+ customer {
334
+ firstname
335
+ lastname
336
+ email
337
+ }
338
+ }
339
+ }
340
+ QUERY ;
341
+ $ this ->graphQlMutation ($ query );
342
+ }
343
+
311
344
public function tearDown ()
312
345
{
313
346
$ newEmail = 'new_customer@example.com ' ;
You can’t perform that action at this time.
0 commit comments