Skip to content

Commit

Permalink
MINOR Documentation in FunctionalTest and TestSession
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@114140 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
chillu committed Nov 24, 2010
1 parent eeed9ce commit 41dad50
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
17 changes: 16 additions & 1 deletion dev/FunctionalTest.php
Expand Up @@ -101,7 +101,22 @@ function post($url, $data, $headers = null, $session = null, $body = null, $cook


/** /**
* Submit the form with the given HTML ID, filling it out with the given data. * Submit the form with the given HTML ID, filling it out with the given data.
* Acts on the most recent response * Acts on the most recent response.
*
* Any data parameters have to be present in the form, with exact form field name
* and values, otherwise they are removed from the submission.
*
* Caution: Parameter names have to be formatted
* as they are in the form submission, not as they are interpreted by PHP.
* Wrong: array('mycheckboxvalues' => array(1 => 'one', 2 => 'two'))
* Right: array('mycheckboxvalues[1]' => 'one', 'mycheckboxvalues[2]' => 'two')
*
* @see http://www.simpletest.org/en/form_testing_documentation.html
*
* @param String $formID HTML 'id' attribute of a form (loaded through a previous response)
* @param String $button HTML 'name' attribute of the button (NOT the 'id' attribute)
* @param Array $data Map of GET/POST data.
* @return SS_HTTPResponse
*/ */
function submitForm($formID, $button = null, $data = array()) { function submitForm($formID, $button = null, $data = array()) {
$this->cssParser = null; $this->cssParser = null;
Expand Down
17 changes: 16 additions & 1 deletion dev/TestSession.php
Expand Up @@ -65,7 +65,22 @@ function post($url, $data, $headers = null, $session = null, $body = null, $cook


/** /**
* Submit the form with the given HTML ID, filling it out with the given data. * Submit the form with the given HTML ID, filling it out with the given data.
* Acts on the most recent response * Acts on the most recent response.
*
* Any data parameters have to be present in the form, with exact form field name
* and values, otherwise they are removed from the submission.
*
* Caution: Parameter names have to be formatted
* as they are in the form submission, not as they are interpreted by PHP.
* Wrong: array('mycheckboxvalues' => array(1 => 'one', 2 => 'two'))
* Right: array('mycheckboxvalues[1]' => 'one', 'mycheckboxvalues[2]' => 'two')
*
* @see http://www.simpletest.org/en/form_testing_documentation.html
*
* @param String $formID HTML 'id' attribute of a form (loaded through a previous response)
* @param String $button HTML 'name' attribute of the button (NOT the 'id' attribute)
* @param Array $data Map of GET/POST data.
* @return SS_HTTPResponse
*/ */
function submitForm($formID, $button = null, $data = array()) { function submitForm($formID, $button = null, $data = array()) {
$page = $this->lastPage(); $page = $this->lastPage();
Expand Down

0 comments on commit 41dad50

Please sign in to comment.