Skip to content

Commit 342675a

Browse files
committed
magento/graphql-ce#271: [My Account] Add support of Customer attributes
- Updating API functional test: adding empty first name scenario for customer account creation API
1 parent 3735e91 commit 342675a

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

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

+35
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,41 @@ public function testCreateCustomerIfPassedAttributeDosNotExistsInCustomerInput()
234234
}
235235
}
236236
}
237+
QUERY;
238+
$this->graphQlQuery($query);
239+
}
240+
241+
/**
242+
* @expectedException \Exception
243+
* @expectedExceptionMessage Required parameters are missing: firstname
244+
*/
245+
public function testCreateCustomerIfNameEmpty()
246+
{
247+
$newEmail = 'customer_created' . rand(1, 2000000) . '@example.com';
248+
$newFirstname = '';
249+
$newLastname = 'Rowe';
250+
$currentPassword = 'test123#';
251+
252+
$query = <<<QUERY
253+
mutation {
254+
createCustomer(
255+
input: {
256+
email: "{$newEmail}"
257+
firstname: "{$newFirstname}"
258+
lastname: "{$newLastname}"
259+
password: "{$currentPassword}"
260+
is_subscribed: true
261+
}
262+
) {
263+
customer {
264+
id
265+
firstname
266+
lastname
267+
email
268+
is_subscribed
269+
}
270+
}
271+
}
237272
QUERY;
238273
$this->graphQlQuery($query);
239274
}

0 commit comments

Comments
 (0)