$data->
add(['redirectTo' => 'frontend.checkout.confirm.page'
]);
$request =
$this->
createRequest();
/** @var CustomerDoubleOptInRegistrationEvent $event */
$event = null;
$this->
catchEvent(CustomerDoubleOptInRegistrationEvent::
class,
$event);
$registerController->
register($request,
$data,
$this->salesChannelContext
);
$customer =
$customerRepository->
search(new Criteria([$event->
getCustomer()->
getId()]),
$this->salesChannelContext->
getContext());
$queryData =
new QueryDataBag();
$queryData->
set('redirectTo', 'frontend.checkout.confirm.page'
);
$queryData->
set('hash',
$customer->
first()->
getHash());
$queryData->
set('em',
hash('sha1',
(string) $event->
getCustomer()->
getEmail()));
/** @var RedirectResponse $response */
$response =
$registerController->
confirmRegistration($this->salesChannelContext,
$queryData);
static::
assertEquals(302,
$response->
getStatusCode());
static::
assertInstanceOf(RedirectResponse::
class,
$response);
static::
assertEquals('/checkout/confirm',
$response->
getTargetUrl());
}