@@ -2072,67 +2072,6 @@ public function testChangePasswordException(): void
2072
2072
$ this ->accountManagement ->changePassword ($ email , $ currentPassword , $ newPassword );
2073
2073
}
2074
2074
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
-
2136
2075
/**
2137
2076
* @param int $isConfirmationRequired
2138
2077
* @param string|null $confirmation
0 commit comments