Permalink
Browse files

Add support for specifying which button should be clicked

  • Loading branch information...
flack committed Dec 5, 2018
1 parent 2dd2ad4 commit f950aa74880c46dc44c6ae2db8373e02c833cb35
Showing with 2 additions and 2 deletions.
  1. +2 −2 test/utilities/testcase.php
@@ -187,7 +187,7 @@ public function submit_dm2_no_relocate_form($controller_key, array $formdata, $c
return $data;
}
public function set_dm_formdata(controller $controller, array $formdata)
public function set_dm_formdata(controller $controller, array $formdata, $button = 'save')
{
$_SERVER['REQUEST_METHOD'] = 'POST';
@@ -199,7 +199,7 @@ public function set_dm_formdata(controller $controller, array $formdata)
$renderer->set_template($view, new datamanager_form($renderer));
$data = eval('return ' . $renderer->block($view, 'form') . ';');
$formname = key($data);
$data[$formname]['form_toolbar']['save0'] = '';
$data[$formname]['form_toolbar'][$button . '0'] = '';
$_POST = [
$formname => array_merge($data[$formname], $formdata)

0 comments on commit f950aa7

Please sign in to comment.