protected function WebTestBase::drupalGetAJAX

Requests a Drupal path in drupal_ajax format, and JSON decodes the response.

4 calls to WebTestBase::drupalGetAJAX()
DialogTest::testDialog in drupal/core/modules/system/lib/Drupal/system/Tests/Ajax/DialogTest.php
Test sending non-JS and AJAX requests to open and manipulate modals.
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().
PreviewTest::testPreviewController in drupal/core/modules/views_ui/lib/Drupal/views_ui/Tests/PreviewTest.php
Tests the actual preview response.

File

drupal/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php, line 1270
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[] = 'Accept: application/vnd.drupal-ajax';
  return drupal_json_decode($this
    ->drupalGet($path, $options, $headers));
}