Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getCaptchas example
]
, CaptchaRouteListener::
getSubscribedEvents
(
)
)
;
}
public
function
testThrowsExceptionWhenValidationFails
(
)
: void
{
$event
=
$this
->
getControllerEventMock
(
)
;
$this
->
expectException
(
CaptchaInvalidException::
class
)
;
(
new
CaptchaRouteListener
(
$this
->
getCaptchas
(
true, false
)
,
$this
->
getContainer
(
)
->
get
(
ErrorController::
class
)
,
$this
->
getContainer
(
)
->
get
(
SystemConfigService::
class
)
)
)
->
validateCaptcha
(
$event
)
;
}
public
function
testJsonResponseWhenCaptchaValidationFails
(
)
: void
{
$systemConfig
=
$this
->
getContainer
(
)
->
get
(
SystemConfigService::
class
)
;
$systemConfig
->
set
(
'core.basicInformation.activeCaptchasV2',
[
BasicCaptcha::CAPTCHA_NAME =>
[