You are here

protected function ContentHubTestBase::drupalGetCdf in Acquia Content Hub 8

Retrieves a Drupal or an absolute CDF 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.

11 calls to ContentHubTestBase::drupalGetCdf()
EntityEmbedTest::testEntityEmbedCdf in tests/src/Functional/EntityEmbedTest.php
Tests acquia_contenthub_cdf format for entity_embed entities inside a node.
FieldClearingNodeTest::testFieldClearing in tests/src/Functional/FieldClearingNodeTest.php
Configure content hub node form.
FieldPermissionsNodeTest::testFieldPermissions in tests/src/Functional/FieldPermissionsNodeTest.php
Configure content hub node form.
FileImageTest::testFileImage in tests/src/Functional/FileImageTest.php
Tests entity CDFs.
IntegrationTest::checkCdfAccess in tests/src/Functional/IntegrationTest.php
Ensures the CDF output is present or not depending of selected role.

... See full list

File

tests/src/Functional/ContentHubTestBase.php, line 207

Class

ContentHubTestBase
Provides the base class for web tests for Search API.

Namespace

Drupal\Tests\acquia_contenthub\Functional

Code

protected function drupalGetCdf($path, array $options = [], array $headers = []) {
  $options = array_merge($options, [
    'query' => [
      '_format' => 'acquia_contenthub_cdf',
    ],
  ]);
  return Json::decode($this
    ->drupalGet($path, $options, $headers));
}