Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
UserRecoveryController example
public
function
testResetRateLimtitUserRecovery
(
)
: void
{
$recoveryService
=
$this
->
createMock
(
UserRecoveryService::
class
)
;
$userEntity
=
new
UserEntity
(
)
;
$userEntity
->
setUsername
(
'admin'
)
;
$userEntity
->
setEmail
(
'
[email protected]
'
)
;
$recoveryService
->
method
(
'getUserByHash'
)
->
willReturn
(
$userEntity
)
;
$recoveryService
->
method
(
'updatePassword'
)
->
willReturn
(
true
)
;
$controller
=
new
UserRecoveryController
(
$recoveryService
,
$this
->
mockResetLimiter
(
[
RateLimiter::OAUTH => 1,
RateLimiter::USER_RECOVERY => 1,
]
)
,
)
;
$controller
->
updateUserPassword
(
new
Request
(
)
,
$this
->context
)
;
}
public
function
testItThrowsExceptionOnInvalidRoute
(
)
: void
{