protected function WebTestBase::drupalGetJSON

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

Parameters

string $path: Path to request AJAX from.

array $options: Array of options to pass to url().

array $headers: Array of headers. Eg array('Accept: application/vnd.drupal-ajax').

Return value

array Decoded json. Requests a Drupal path in JSON format, and JSON decodes the response.

3 calls to WebTestBase::drupalGetJSON()
StyleSerializerTest::testFieldRawOutput in drupal/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php
Tests the raw output options for row field rendering.
StyleSerializerTest::testUIFieldAlias in drupal/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php
Test the field ID alias functionality of the DataFieldRow plugin.
UserAutocompleteTest::testUserAutocomplete in drupal/core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php
Tests access to user autocompletion and verify the correct results.

File

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

Class

WebTestBase
Test case for typical Drupal tests.

Namespace

Drupal\simpletest

Code

protected function drupalGetJSON($path, array $options = array(), array $headers = array()) {
  $headers[] = 'Accept: application/json';
  return drupal_json_decode($this
    ->drupalGet($path, $options, $headers));
}