From fe89ce4bd0e60cbc9fdfe8044602fa0de72ea7ad Mon Sep 17 00:00:00 2001 From: Alex Taranovsky Date: Mon, 11 Nov 2019 00:10:58 +0200 Subject: [PATCH] magento/devdocs#: createCustomer. Test coverage. Case: create new customer with the email of already existent user --- .../GraphQl/Customer/CreateCustomerTest.php | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php index 0be968d6d340d..85e5a0dae11e2 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php @@ -308,6 +308,39 @@ public function testCreateCustomerSubscribed() $this->assertEquals(false, $response['createCustomer']['customer']['is_subscribed']); } + /** + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @expectedException \Exception + * @expectedExceptionMessage A customer with the same email address already exists in an associated website. + */ + public function testCreateCustomerIfCustomerWithProvidedEmailAlreadyExists() + { + $existedEmail = 'customer@example.com'; + $password = 'test123#'; + $firstname = 'John'; + $lastname = 'Smith'; + + $query = <<graphQlMutation($query); + } + public function tearDown() { $newEmail = 'new_customer@example.com';