#789186 follow-up by eojthebrave: Better documentation for drupalPostAJAX()

merge-requests/26/head
Angie Byron 2011-01-28 07:01:03 +00:00
parent f69f43dee3
commit d5d1366e6b
1 changed files with 33 additions and 0 deletions

View File

@ -1892,6 +1892,39 @@ class DrupalWebTestCase extends DrupalTestCase {
* array of commands, to update $this->content using equivalent DOM
* manipulation as is used by ajax.js. It also returns the array of commands.
*
* @param $path
* Location of the form containing the AJAX enabled element to test. Can be
* either a Drupal path or an absolute path or NULL to use the current page.
* @param $edit
* Field data in an associative array. Changes the current input fields
* (where possible) to the values indicated.
* @param $triggering_element
* The name of the form element that is responsible for triggering the AJAX
* functionality to test. May be a string or, if the triggering element is
* a button, an associative array where the key is the name of the button
* and the value is the button label. i.e.) array('op' => t('Refresh')).
* @param $ajax_path
* (optional) Override the path set by the AJAX settings of the triggering
* element. In the absence of both the triggering element's AJAX path and
* $ajax_path 'system/ajax' will be used.
* @param $options
* (optional) Options to be forwarded to url().
* @param $headers
* (optional) An array containing additional HTTP request headers, each
* formatted as "name: value". Forwarded to drupalPost().
* @param $form_html_id
* (optional) HTML ID of the form to be submitted, use when there is more
* than one identical form on the same page and the value of the triggering
* element is not enough to identify the form. Note this is not the Drupal
* ID of the form but rather the HTML ID of the form.
* @param $ajax_settings
* (optional) An array of AJAX settings which if specified will be used in
* place of the AJAX settings of the triggering element.
*
* @return
* An array of AJAX commands.
*
* @see drupalPost()
* @see ajax.js
*/
protected function drupalPostAJAX($path, $edit, $triggering_element, $ajax_path = NULL, array $options = array(), array $headers = array(), $form_html_id = NULL, $ajax_settings = NULL) {