Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
AuthTestSubscriber example
public
function
testGenerateAccountRecovery
(
)
: void
{
$logger
=
$this
->
getContainer
(
)
->
get
(
'monolog.logger.business_events'
)
;
$handlers
=
$logger
->
getHandlers
(
)
;
$logger
->
setHandlers
(
[
new
ExcludeFlowEventHandler
(
$this
->
getContainer
(
)
->
get
(
DoctrineSQLHandler::
class
)
,
[
CustomerAccountRecoverRequestEvent::EVENT_NAME,
]
)
,
]
)
;
$testSubscriber
=
new
AuthTestSubscriber
(
)
;
$this
->
getContainer
(
)
->
get
(
'event_dispatcher'
)
->
addSubscriber
(
$testSubscriber
)
;
/** @var CustomerEntity|null $customer */
$customer
=
$this
->
createCustomer
(
)
;
static
::
assertNotNull
(
$customer
)
;
$controller
=
$this
->
getAuthController
(
$this
->
getContainer
(
)
->
get
(
SendPasswordRecoveryMailRoute::
class
)
)
;
$request
=
$this
->
createRequest
(
'frontend.account.recover.request'
)
;