disableSecurityToken(); $handler = new TestFormRequestHandler($form); $request = new HTTPRequest('POST', '/', null, ['action_mySubmitOnFormHandler' => 1]); $request->setSession(new Session([])); $response = $handler->httpSubmission($request); $this->assertFalse($response->isError()); } public function testCallsActionOnForm() { $form = new TestForm( Controller::curr(), 'Form', new FieldList(), new FieldList(new FormAction('mySubmitOnForm')) ); $form->disableSecurityToken(); $handler = new FormRequestHandler($form); $request = new HTTPRequest('POST', '/', null, ['action_mySubmitOnForm' => 1]); $request->setSession(new Session([])); $response = $handler->httpSubmission($request); $this->assertFalse($response->isError()); } }