You are here

protected function S3FileTestTrait::getFileFixture in Acquia Content Hub 8.2

Returns the contents of an arbitrary file fixture.

Return value

array The cdf array.

1 call to S3FileTestTrait::getFileFixture()
S3FileEntityHandlerTest::testOnParseCdf in modules/acquia_contenthub_s3/tests/src/Kernel/S3FileEntityHandlerTest.php
@covers ::onParseCdf

File

modules/acquia_contenthub_s3/tests/src/Kernel/S3FileTestTrait.php, line 25

Class

S3FileTestTrait
Provides common methods for s3 related tests.

Namespace

Drupal\Tests\acquia_contenthub_s3\Kernel

Code

protected function getFileFixture(string $file_name) : array {
  $location = drupal_get_path('module', 'acquia_contenthub_s3') . "/tests/fixtures/file/{$file_name}";
  $data = json_decode(file_get_contents($location), TRUE);
  return is_array($data) ? $data : [];
}