only in patch2: unchanged: --- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php @@ -1189,7 +1189,10 @@ protected function drupalGet($path, array $options = array(), array $headers = a * Retrieve a Drupal path or an absolute path and JSON decode the result. */ protected function drupalGetAJAX($path, array $options = array(), array $headers = array()) { + // Emulate the headers that jQuery sends. $headers[] = 'X-Requested-With: XMLHttpRequest'; + $headers[] = 'Accept: application/vnd.drupal-ajax, */*; q=0.01'; + return drupal_json_decode($this->drupalGet($path, $options, $headers)); } @@ -1410,7 +1413,10 @@ protected function drupalPostAJAX($path, $edit, $triggering_element, $ajax_path } $content = $this->content; $drupal_settings = $this->drupalSettings; + + // Emulate the headers that jQuery sends. $headers[] = 'X-Requested-With: XMLHttpRequest'; + $headers[] = 'Accept: application/vnd.drupal-ajax, */*; q=0.01'; // Get the Ajax settings bound to the triggering element. if (!isset($ajax_settings)) {