8 declare(strict_types=1);
14 use PHPUnit\Framework\TestCase;
29 private $frontController;
34 private $formKeyValidator;
44 FrontController::class
46 $this->formKeyValidator =
$objectManager->get(FormKeyValidator::class);
55 $this->markTestSkipped(
56 'Can\'t test dispatch process without sending headers' 59 $_SERVER[
'HTTP_HOST'] =
'localhost';
60 $formKey =
'customFormKey';
61 $_COOKIE[
'form_key'] = $formKey;
62 $this->request->setMethod(HttpRequest::METHOD_POST);
63 $this->request->setParam(
'form_key', $formKey);
64 $this->request->setRequestUri(
'core/index/index');
65 $this->frontController->dispatch($this->request);
66 $this->assertTrue($this->formKeyValidator->validate($this->request));
static getObjectManager()