You are here

private function IndexFacetsTest::doRequest in JSON:API Search API 8

Do a request.

Parameters

\Drupal\Core\Url $url: The URL.

Return value

array The decoded response JSON.

3 calls to IndexFacetsTest::doRequest()
IndexFacetsTest::testEmptyFacets in modules/jsonapi_search_api_facets/tests/src/Functional/IndexFacetsTest.php
Tests facets are rendeted properly when empty.
IndexFacetsTest::testWithExistingFilter in modules/jsonapi_search_api_facets/tests/src/Functional/IndexFacetsTest.php
Tests that existing filters are preserved in facet term URLs.
IndexFacetsTest::testWithFacets in modules/jsonapi_search_api_facets/tests/src/Functional/IndexFacetsTest.php
Test facet data.

File

modules/jsonapi_search_api_facets/tests/src/Functional/IndexFacetsTest.php, line 458

Class

IndexFacetsTest
Tests searching with facets.

Namespace

Drupal\Tests\jsonapi_search_api_facets\Functional

Code

private function doRequest(Url $url) {
  $request_options = [];
  $request_options[RequestOptions::HEADERS]['Accept'] = 'application/vnd.api+json';
  $response = $this
    ->request('GET', $url, $request_options);
  $this
    ->assertSame(200, $response
    ->getStatusCode(), var_export(Json::decode((string) $response
    ->getBody()), TRUE));
  return Json::decode((string) $response
    ->getBody());
}