-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENGCOM-6263: magento/devdocs#: createCustomer. Test coverage. Case: c…
…reate new customer with the email of already existent user #1053
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
} | ||
} | ||
} | ||
QUERY; | ||
$this->graphQlMutation($query); | ||
} | ||
|
||
public function tearDown() | ||
{ | ||
$newEmail = '[email protected]'; | ||
|