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
  • Loading branch information
lenaorobei authored Nov 13, 2019
2 parents f7727e4 + d639f95 commit 915c596
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 = '[email protected]';
$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 = '[email protected]';
Expand Down

0 comments on commit 915c596

Please sign in to comment.