Added Form::testSubmission() and Form::testAjaxSubmission() to aid unit testing

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@40423 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2007-08-17 05:44:46 +00:00
parent ac29eb5b89
commit 9b045b61db

View File

@ -644,7 +644,14 @@ class Form extends ViewableData {
function testSubmission($action, $data) {
$data['action_' . $action] = true;
$data['executeForm'] = $this->name;
//$this->controller->run()
$response = $this->controller->run($data);
return $response;
}
function testAjaxSubmission($action, $data) {
$data['ajax'] = 1;
return $this->testSubmission($action, $data);
}
}