mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
ac29eb5b89
commit
9b045b61db
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user