You are here

protected function ImportExportTestBase::createCdfDocumentFromFixture in Acquia Content Hub 8.2

Creates CDF document from fixture.

Parameters

int $delta: The delta of the filename to retrieve from the local fixtures property.

Return value

\Acquia\ContentHubClient\CDFDocument CDF document.

Throws

\Exception

3 calls to ImportExportTestBase::createCdfDocumentFromFixture()
ImportExportTestBase::importFixture in tests/src/Kernel/ImportExportTestBase.php
Import fixture.
PreExistingTermMultipleParentImportExportTest::testTermImportExport1 in tests/src/Kernel/PreExistingTermMultipleParentImportExportTest.php
Performs tests with taxonomy term with multiple parents.
PreExistingTermMultipleParentImportExportTest::testTermImportExport2 in tests/src/Kernel/PreExistingTermMultipleParentImportExportTest.php
Performs tests with taxonomy term with multiple parents.

File

tests/src/Kernel/ImportExportTestBase.php, line 142

Class

ImportExportTestBase
Base for testing exports and imports.

Namespace

Drupal\Tests\acquia_contenthub\Kernel

Code

protected function createCdfDocumentFromFixture(int $delta) : CDFDocument {
  $json = $this
    ->getFixtureString($delta);
  $data = Json::decode($json);
  $document_parts = [];
  foreach ($data['entities'] as $entity) {
    $document_parts[] = $this
      ->populateCdfObject($entity);
  }
  $cdf_document = new CDFDocument(...$document_parts);
  return $cdf_document;
}