protected function WebTestBase::drupalGetAJAX

Retrieve a Drupal path or an absolute path and JSON decode the result.

2 calls to WebTestBase::drupalGetAJAX()
FrameworkTest::testAJAXRender in drupal/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php
Ensures ajax_render() returns JavaScript settings from the page request.
FrameworkTest::testAJAXRenderError in drupal/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php
Tests behavior of ajax_render_error().

File

drupal/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php, line 1094
Definition of Drupal\simpletest\WebTestBase.

Class

WebTestBase
Test case for typical Drupal tests.

Namespace

Drupal\simpletest

Code

protected function drupalGetAJAX($path, array $options = array(), array $headers = array()) {
  $headers[] = 'X-Requested-With: XMLHttpRequest';
  return drupal_json_decode($this
    ->drupalGet($path, $options, $headers));
}