You are here

protected function ImportExportTestBase::getFixtureString in Acquia Content Hub 8.2

Returns fixture content.

Parameters

int $delta: Fixture delta.

Return value

false|string Fixture string if file exists.

Throws

\Exception

4 calls to ImportExportTestBase::getFixtureString()
ImportExportTestBase::assertExportedConfigEntities in tests/src/Kernel/ImportExportTestBase.php
Executes assertions on a set of exported configuration entities.
ImportExportTestBase::contentEntityImportExport in tests/src/Kernel/ImportExportTestBase.php
Import and export content.
ImportExportTestBase::createCdfDocumentFromFixture in tests/src/Kernel/ImportExportTestBase.php
Creates CDF document from fixture.
WebformSubmissionImportExportTest::testWebformSubmissionImportExport in tests/src/Kernel/WebformSubmissionImportExportTest.php
The webform submission import export test.

File

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

Class

ImportExportTestBase
Base for testing exports and imports.

Namespace

Drupal\Tests\acquia_contenthub\Kernel

Code

protected function getFixtureString(int $delta) {
  if (!empty($this->fixtures[$delta])) {
    $version_directory = $this
      ->getDrupalVersion();
    $path_to_fixture = sprintf("%s/tests/fixtures/import/{$version_directory}/%s", drupal_get_path('module', 'acquia_contenthub'), $this->fixtures[$delta]['cdf']);
    return file_get_contents($path_to_fixture);
  }
  throw new \Exception(sprintf("Missing fixture for delta %d in class %s", $delta, __CLASS__));
}