Add pre-request for the form key

This commit is contained in:
Dave Smith-Hayes 2024-12-02 20:04:48 +00:00
parent bf48532ac1
commit 7c9f5f6bf8

View File

@ -100,7 +100,13 @@ class RegisterUserActionTest extends TestCase
$userRepository->reveal()
);
$request = $this->createNewUserRequest();
// get the form key
$getUserRequest = $this->createNewUserRequestForFormKey();
$response = $app->handle($getUserRequest);
$formKey = $container->get(SessionInterface::class)->get("form_key");
$this->assertIsString($formKey);
$request = $this->createNewUserRequest($formKey);
$response = $app->handle($request);
$this->assertEquals(400, $response->getStatusCode());