Skip to content

Commit fc53cf2

Browse files
ENGCOM-6062: Cover exceptions in \Magento\CustomerGraphQl\Model\Resolver\CreateCustomerAddress #1001
- Merge Pull Request magento/graphql-ce#1001 from TomashKhamlai/graphql-ce:coverage-create-customer-address-input - Merged commits: 1. f1e8568
2 parents 0714971 + f1e8568 commit fc53cf2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerAddressTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,27 @@ public function testCreateCustomerAddressWithMissingAttribute()
202202
$this->graphQlMutation($mutation, [], '', $this->getCustomerAuthHeaders($userName, $password));
203203
}
204204

205+
/**
206+
* @magentoApiDataFixture Magento/Customer/_files/customer_without_addresses.php
207+
* @expectedException Exception
208+
* @expectedExceptionMessage "input" value should be specified
209+
*/
210+
public function testCreateCustomerAddressWithMissingInput()
211+
{
212+
$userName = 'customer@example.com';
213+
$password = 'password';
214+
$mutation = <<<MUTATION
215+
mutation {
216+
createCustomerAddress(
217+
input: {}
218+
) {
219+
city
220+
}
221+
}
222+
MUTATION;
223+
$this->graphQlMutation($mutation, [], '', $this->getCustomerAuthHeaders($userName, $password));
224+
}
225+
205226
/**
206227
* @magentoApiDataFixture Magento/Customer/_files/customer_without_addresses.php
207228
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)

0 commit comments

Comments
 (0)