Skip to content

Commit 7834423

Browse files
committed
LYNX-232: Optimizations generateCustomerToken
- remove unit test as there is an integration that test same scenario
1 parent 3e00143 commit 7834423

File tree

1 file changed

+0
-61
lines changed

1 file changed

+0
-61
lines changed

app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -2072,67 +2072,6 @@ public function testChangePasswordException(): void
20722072
$this->accountManagement->changePassword($email, $currentPassword, $newPassword);
20732073
}
20742074

2075-
/**
2076-
* @return void
2077-
* @throws LocalizedException
2078-
*/
2079-
public function testAuthenticate(): void
2080-
{
2081-
$username = 'login';
2082-
$password = '1234567';
2083-
$passwordHash = '1a2b3f4c';
2084-
2085-
$customerData = $this->getMockBuilder(Customer::class)
2086-
->disableOriginalConstructor()
2087-
->getMock();
2088-
2089-
$customerModel = $this->getMockBuilder(\Magento\Customer\Model\Customer::class)
2090-
->disableOriginalConstructor()
2091-
->getMock();
2092-
$customerModel->expects($this->once())
2093-
->method('updateData')
2094-
->willReturn($customerModel);
2095-
2096-
$this->customerRepository
2097-
->expects($this->once())
2098-
->method('get')
2099-
->with($username)
2100-
->willReturn($customerData);
2101-
2102-
$this->authenticationMock->expects($this->once())
2103-
->method('authenticate');
2104-
2105-
$customerSecure = $this->getMockBuilder(CustomerSecure::class)
2106-
->addMethods(['getPasswordHash'])
2107-
->disableOriginalConstructor()
2108-
->getMock();
2109-
$customerSecure->expects($this->any())
2110-
->method('getPasswordHash')
2111-
->willReturn($passwordHash);
2112-
2113-
$this->customerRegistry->expects($this->any())
2114-
->method('retrieveSecureData')
2115-
->willReturn($customerSecure);
2116-
2117-
$this->customerFactory->expects($this->once())
2118-
->method('create')
2119-
->willReturn($customerModel);
2120-
2121-
$this->manager->expects($this->exactly(2))
2122-
->method('dispatch')
2123-
->withConsecutive(
2124-
[
2125-
'customer_customer_authenticated',
2126-
['model' => $customerModel, 'password' => $password]
2127-
],
2128-
[
2129-
'customer_data_object_login', ['customer' => $customerData]
2130-
]
2131-
);
2132-
2133-
$this->assertEquals($customerData, $this->accountManagement->authenticate($username, $password));
2134-
}
2135-
21362075
/**
21372076
* @param int $isConfirmationRequired
21382077
* @param string|null $confirmation

0 commit comments

Comments
 (0)