'',
'/shopware_basic_captcha_confirm',
'',
null,
'captcha.basic-captcha-invalid'
));
$request =
$this->
createRequest();
$this->
getContainer()->
get('request_stack'
)->
push($request);
/** @var StorefrontResponse $response */
$response =
$this->controller->
onCaptchaFailure($violations,
$request);
static::
assertInstanceOf(StorefrontResponse::
class,
$response);
static::
assertSame(200,
$response->
getStatusCode());
static::
assertSame('frontend.account.home.page',
$response->
getData()['redirectTo'
]);
$apiRequest =
$request;
$apiRequest->headers->
set('X-Requested-With', 'XMLHttpRequest'
);
$response =
$this->controller->
onCaptchaFailure($violations,
$apiRequest);
$responseContent =
$response->
getContent();
$content =
json_decode((string) $responseContent, true, 512, \JSON_THROW_ON_ERROR
);
$type =
$content[0
]['type'
];
static::
assertInstanceOf(JsonResponse::
class,
$response);