You are here

protected function WebTestBase::drupalGetWithFormat in Zircon Profile 8.0

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

Retrieves a Drupal path or an absolute path for a given format.

Parameters

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

string $format: The wanted request format.

array $options: Array of URL options.

array $headers: Array of headers.

Return value

mixed The result of the request.

5 calls to WebTestBase::drupalGetWithFormat()
CommentRestExportTest::testCommentRestExport in core/modules/comment/src/Tests/Views/CommentRestExportTest.php
Test comment row.
StyleSerializerTest::testResponseFormatConfiguration in core/modules/rest/src/Tests/Views/StyleSerializerTest.php
Tests the response format configuration.
StyleSerializerTest::testRestRenderCaching in core/modules/rest/src/Tests/Views/StyleSerializerTest.php
Tests REST export with views render caching enabled.
StyleSerializerTest::testSerializerResponses in core/modules/rest/src/Tests/Views/StyleSerializerTest.php
Checks the behavior of the Serializer callback paths and row plugins.
WebTestBase::drupalGetJSON in core/modules/simpletest/src/WebTestBase.php
Retrieves a Drupal path or an absolute path and JSON decodes the result.

File

core/modules/simpletest/src/WebTestBase.php, line 1580
Contains \Drupal\simpletest\WebTestBase.

Class

WebTestBase
Test case for typical Drupal tests.

Namespace

Drupal\simpletest

Code

protected function drupalGetWithFormat($path, $format, array $options = [], array $headers = []) {
  $options += [
    'query' => [
      '_format' => $format,
    ],
  ];
  return $this
    ->drupalGet($path, $options, $headers);
}