Skip to content

Commit

Permalink
ENGCOM-6263: magento/devdocs#: createCustomer. Test coverage. Case: c…
Browse files Browse the repository at this point in the history
…reate new customer with the email of already existent user #1053

 - Merge Pull Request magento/graphql-ce#1053 from magento/graphql-ce:createCustomer-test-coverage
 - Merged commits:
   1. fe89ce4
  • Loading branch information
magento-engcom-team committed Nov 11, 2019
2 parents 439d2ab + fe89ce4 commit d639f95
Showing 1 changed file with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <<<QUERY
mutation {
createCustomer(
input: {
email: "{$existedEmail}"
password: "{$password}"
firstname: "{$firstname}"
lastname: "{$lastname}"
}
) {
customer {
firstname
lastname
email
}
}
}
QUERY;
$this->graphQlMutation($query);
}

public function tearDown()
{
$newEmail = 'new_customer@example.com';
Expand Down

0 comments on commit d639f95

Please sign in to comment.