From 59ceca0caf52002cf44206feec7c7213bc079939 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sat, 21 Nov 2009 00:43:42 +0000 Subject: #633156 follow-up by effulgentsia and yched: Clean up AJAX tests, add sister function to drupal_js_encode(). --- modules/simpletest/drupal_web_test_case.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'modules/simpletest/drupal_web_test_case.php') diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index c1642e5b6..998716926 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -1404,8 +1404,7 @@ class DrupalWebTestCase extends DrupalTestCase { * Retrieve a Drupal path or an absolute path and JSON decode the result. */ function drupalGetAJAX($path, array $options = array(), array $headers = array()) { - $out = $this->drupalGet($path, $options, $headers); - return json_decode($out, TRUE); + return drupal_json_decode($this->drupalGet($path, $options, $headers)); } /** @@ -1545,8 +1544,7 @@ class DrupalWebTestCase extends DrupalTestCase { * Execute a POST request on an AJAX path and JSON decode the result. */ protected function drupalPostAJAX($path, $edit, $triggering_element, $ajax_path = 'system/ajax', array $options = array(), array $headers = array()) { - $out = $this->drupalPost($path, $edit, array('path' => $ajax_path, 'triggering_element' => $triggering_element), $options, $headers); - return json_decode($out, TRUE); + return drupal_json_decode($this->drupalPost($path, $edit, array('path' => $ajax_path, 'triggering_element' => $triggering_element), $options, $headers)); } /** -- cgit v1.2.3