diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-03-27 18:32:06 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-03-27 18:32:06 +0000 |
commit | be6d3c8bb601fa53839b6c187b31e883e3334560 (patch) | |
tree | b205c6698689160601ac9bd254195cbe73ddee9b /modules/simpletest/drupal_web_test_case.php | |
parent | cb112e9a346f8c1f3dda28055e0081ed33b5dcb4 (diff) | |
download | brdo-be6d3c8bb601fa53839b6c187b31e883e3334560.tar.gz brdo-be6d3c8bb601fa53839b6c187b31e883e3334560.tar.bz2 |
#601398 follow-up by andypost, rfay, and sun: Allow drupLPost to target specific form HTML ID for multiple similar forms.
Diffstat (limited to 'modules/simpletest/drupal_web_test_case.php')
-rw-r--r-- | modules/simpletest/drupal_web_test_case.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index b6bda06c9..81270b2f9 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -1600,12 +1600,15 @@ class DrupalWebTestCase extends DrupalTestCase { * @param $headers * An array containing additional HTTP request headers, each formatted as * "name: value". - * @param $form_id - * The optional string identifying the form to be submitted. On some pages + * @param $form_html_id + * (optional) HTML ID of the form to be submitted. On some pages * there are many identical forms, so just using the value of the submit - * button is not enough. + * button is not enough. For example: 'trigger-node-presave-assign-form'. + * Note that this is not the Drupal $form_id, but rather the HTML ID of the + * form, which is typically the same thing but with hyphens replacing the + * underscores. */ - protected function drupalPost($path, $edit, $submit, array $options = array(), array $headers = array(), $form_id = NULL) { + protected function drupalPost($path, $edit, $submit, array $options = array(), array $headers = array(), $form_html_id = NULL) { $submit_matches = FALSE; $ajax = is_array($submit); if (isset($path)) { @@ -1615,8 +1618,8 @@ class DrupalWebTestCase extends DrupalTestCase { $edit_save = $edit; // Let's iterate over all the forms. $xpath = "//form"; - if (!empty($form_id)) { - $xpath .= "[@id='" . drupal_html_id($form_id) . "']"; + if (!empty($form_html_id)) { + $xpath .= "[@id='" . $form_html_id . "']"; } $forms = $this->xpath($xpath); foreach ($forms as $form) { |