Skip to content

Commit 1af63c7

Browse files
committed
GraphQL-672: Change customer password
1 parent 02bca98 commit 1af63c7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,24 @@ public function testChangePasswordIfPasswordIsInvalid()
111111
$this->graphQlMutation($query, [], '', $headerMap);
112112
}
113113

114+
/**
115+
* @magentoApiDataFixture Magento/Customer/_files/customer.php
116+
* @expectedException \Exception
117+
* @expectedExceptionMessage Specify the "currentPassword" value.
118+
*/
119+
public function testChangePasswordIfCurrentPasswordIsEmpty()
120+
{
121+
$customerEmail = '[email protected]';
122+
$oldCustomerPassword = 'password';
123+
$newCustomerPassword = 'anotherPassword1';
124+
$incorrectPassword = '';
125+
126+
$query = $this->getChangePassQuery($incorrectPassword, $newCustomerPassword);
127+
128+
$headerMap = $this->getCustomerAuthHeaders($customerEmail, $oldCustomerPassword);
129+
$this->graphQlMutation($query, [], '', $headerMap);
130+
}
131+
114132
private function getChangePassQuery($currentPassword, $newPassword)
115133
{
116134
$query = <<<QUERY

0 commit comments

Comments
 (0)