You are here

protected function WebTestBase::drupalGetJSON in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/simpletest/src/WebTestBase.php \Drupal\simpletest\WebTestBase::drupalGetJSON()

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

Parameters

\Drupal\Core\Url|string $path: Drupal path or URL to request AJAX from.

array $options: Array of URL options.

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

Return value

array Decoded json.

5 calls to WebTestBase::drupalGetJSON()
StyleSerializerTest::testFieldapiField in core/modules/rest/src/Tests/Views/StyleSerializerTest.php
Tests the field row style using fieldapi fields.
StyleSerializerTest::testFieldRawOutput in core/modules/rest/src/Tests/Views/StyleSerializerTest.php
Tests the raw output options for row field rendering.
StyleSerializerTest::testRestRenderCaching in core/modules/rest/src/Tests/Views/StyleSerializerTest.php
Tests REST export with views render caching enabled.
StyleSerializerTest::testRestViewExposedFilter in core/modules/rest/src/Tests/Views/StyleSerializerTest.php
Tests the exposed filter works.
StyleSerializerTest::testUIFieldAlias in core/modules/rest/src/Tests/Views/StyleSerializerTest.php
Test the field ID alias functionality of the DataFieldRow plugin.

File

core/modules/simpletest/src/WebTestBase.php, line 1561
Contains \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()) {
  return Json::decode($this
    ->drupalGetWithFormat($path, 'json', $options, $headers));
}