Skip to content

Commit 89e61e9

Browse files
committed
GraphQL-672: Change customer password > Check if new password is empty
1 parent 1af63c7 commit 89e61e9

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

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

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,31 @@ public function testChangePasswordIfCurrentPasswordIsEmpty()
121121
$customerEmail = '[email protected]';
122122
$oldCustomerPassword = 'password';
123123
$newCustomerPassword = 'anotherPassword1';
124-
$incorrectPassword = '';
124+
$currentCustomerPassword = '';
125125

126-
$query = $this->getChangePassQuery($incorrectPassword, $newCustomerPassword);
126+
$query = $this->getChangePassQuery($currentCustomerPassword, $newCustomerPassword);
127127

128128
$headerMap = $this->getCustomerAuthHeaders($customerEmail, $oldCustomerPassword);
129129
$this->graphQlMutation($query, [], '', $headerMap);
130130
}
131131

132+
/**
133+
* @magentoApiDataFixture Magento/Customer/_files/customer.php
134+
* @expectedException \Exception
135+
* @expectedExceptionMessage Specify the "newPassword" value.
136+
*/
137+
public function testChangePasswordIfNewPasswordIsEmpty()
138+
{
139+
$customerEmail = '[email protected]';
140+
$currentCustomerPassword = 'password';
141+
$newCustomerPassword = '';
142+
143+
$query = $this->getChangePassQuery($currentCustomerPassword, $newCustomerPassword);
144+
145+
$headerMap = $this->getCustomerAuthHeaders($customerEmail, $currentCustomerPassword);
146+
$this->graphQlMutation($query, [], '', $headerMap);
147+
}
148+
132149
private function getChangePassQuery($currentPassword, $newPassword)
133150
{
134151
$query = <<<QUERY

0 commit comments

Comments
 (0)