summaryrefslogtreecommitdiff
path: root/modules/simpletest/drupal_web_test_case.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/simpletest/drupal_web_test_case.php')
-rw-r--r--modules/simpletest/drupal_web_test_case.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index 67533c81e..e52f0cad9 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -1801,7 +1801,7 @@ class DrupalWebTestCase extends DrupalTestCase {
*
* @see ajax.js
*/
- protected function drupalPostAJAX($path, $edit, $triggering_element, $ajax_path = 'system/ajax', array $options = array(), array $headers = array(), $form_html_id = NULL, $ajax_settings = NULL) {
+ protected function drupalPostAJAX($path, $edit, $triggering_element, $ajax_path = NULL, array $options = array(), array $headers = array(), $form_html_id = NULL, $ajax_settings = NULL) {
// Get the content of the initial page prior to calling drupalPost(), since
// drupalPost() replaces $this->content.
if (isset($path)) {
@@ -1838,6 +1838,12 @@ class DrupalWebTestCase extends DrupalTestCase {
$extra_post .= '&' . urlencode('ajax_html_ids[]') . '=' . urlencode($id);
}
+ // Unless a particular path is specified, use the one specified by the
+ // AJAX settings, or else 'system/ajax'.
+ if (!isset($ajax_path)) {
+ $ajax_path = isset($ajax_settings['url']) ? $ajax_settings['url'] : 'system/ajax';
+ }
+
// Submit the POST request.
$return = drupal_json_decode($this->drupalPost(NULL, $edit, array('path' => $ajax_path, 'triggering_element' => $triggering_element), $options, $headers, $form_html_id, $extra_post));