Skip to content

Commit c6eefe2

Browse files
committed
magento/graphql-ce#674: [Test coverage] Customer addresses
- fixed web-api tests
1 parent d7c302b commit c6eefe2

File tree

2 files changed

+8
-22
lines changed

2 files changed

+8
-22
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,9 @@ public function testCreateCustomerAddressWithInvalidInput($input, $exceptionMess
302302
public function invalidInputDataProvider()
303303
{
304304
return [
305-
['', 'GraphQL response contains errors: Syntax Error: Expected Name, found )'],
306-
['input: ""', 'GraphQL response contains errors: Expected type CustomerAddressInput!, found "".'],
307-
['input: "foo"', 'GraphQL response contains errors: Expected type CustomerAddressInput!, found "foo".']
305+
['', 'Syntax Error: Expected Name, found )'],
306+
['input: ""', 'Expected type CustomerAddressInput!, found "".'],
307+
['input: "foo"', 'Expected type CustomerAddressInput!, found "foo".']
308308
];
309309
}
310310

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

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,7 @@ public function testUpdateCustomerAddressWithMissingId()
211211

212212
$this->expectException(Exception::class);
213213
$this->expectExceptionMessage(
214-
'GraphQL response contains errors: Field "updateCustomerAddress" argument "id" of type "Int!" is ' .
215-
'required but not provided.'
214+
'Field "updateCustomerAddress" argument "id" of type "Int!" is required but not provided.'
216215
);
217216
$this->graphQlMutation($mutation, [], '', $this->getCustomerAuthHeaders($userName, $password));
218217
}
@@ -271,19 +270,6 @@ public function testUpdateCustomerAddressWithInvalidIdType()
271270
$this->graphQlMutation($mutation, [], '', $this->getCustomerAuthHeaders($userName, $password));
272271
}
273272

274-
/**
275-
* @return array
276-
*/
277-
public function invalidIdDataProvider()
278-
{
279-
return [
280-
['', 'GraphQL response contains errors: Field "updateCustomerAddress" argument "id" of type "Int!" ' .
281-
'is required but not provided.'],
282-
//TODO: why here the internal server error being trowed?
283-
['id: ""', 'GraphQL response contains errors: Internal server error']
284-
];
285-
}
286-
287273
/**
288274
* Update address with invalid input
289275
*
@@ -319,17 +305,17 @@ public function testUpdateCustomerAddressWithInvalidInput(string $input, string
319305
public function invalidInputDataProvider()
320306
{
321307
return [
322-
['', 'GraphQL response contains errors: "input" value should be specified'],
323-
['input: ""', 'GraphQL response contains errors: Expected type CustomerAddressInput, found "".'],
324-
['input: "foo"', 'GraphQL response contains errors: Expected type CustomerAddressInput, found "foo".']
308+
['', '"input" value must be specified'],
309+
['input: ""', 'Expected type CustomerAddressInput, found ""'],
310+
['input: "foo"', 'Expected type CustomerAddressInput, found "foo"']
325311
];
326312
}
327313

328314
/**
329315
* @magentoApiDataFixture Magento/Customer/_files/customer.php
330316
* @magentoApiDataFixture Magento/Customer/_files/customer_address.php
331317
* @expectedException Exception
332-
* @expectedExceptionMessage GraphQL response contains errors: Could not find a address with ID "9999"
318+
* @expectedExceptionMessage Could not find a address with ID "9999"
333319
*/
334320
public function testUpdateNotExistingCustomerAddress()
335321
{

0 commit comments

Comments
 (0)