Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Commit

Permalink
Cover exceptions in \Magento\CustomerGraphQl\Model\Resolver\CreateCus…
Browse files Browse the repository at this point in the history
…tomerAddress

Cover exception:
`"input" value should be specified`

Signed-off-by: Tomash Khamlai <[email protected]>
  • Loading branch information
TomashKhamlai committed Oct 11, 2019
1 parent 0714971 commit f1e8568
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,27 @@ public function testCreateCustomerAddressWithMissingAttribute()
$this->graphQlMutation($mutation, [], '', $this->getCustomerAuthHeaders($userName, $password));
}

/**
* @magentoApiDataFixture Magento/Customer/_files/customer_without_addresses.php
* @expectedException Exception
* @expectedExceptionMessage "input" value should be specified
*/
public function testCreateCustomerAddressWithMissingInput()
{
$userName = '[email protected]';
$password = 'password';
$mutation = <<<MUTATION
mutation {
createCustomerAddress(
input: {}
) {
city
}
}
MUTATION;
$this->graphQlMutation($mutation, [], '', $this->getCustomerAuthHeaders($userName, $password));
}

/**
* @magentoApiDataFixture Magento/Customer/_files/customer_without_addresses.php
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
Expand Down

0 comments on commit f1e8568

Please sign in to comment.