You are here

protected function S3FileOriginLocatorTest::initFileFixture in Acquia Content Hub 8.2

Initializes a file and inserts it into s3 file map table.

Parameters

string $bucket: The s3 source of the file.

string $root_folder: The s3 source of the file.

Return value

\Drupal\file\FileInterface The file entity.

Throws

\Drupal\Core\Entity\EntityStorageException

1 call to S3FileOriginLocatorTest::initFileFixture()
S3FileOriginLocatorTest::runTestWith in modules/acquia_contenthub_s3/tests/src/Kernel/S3FileOriginLocatorTest.php
Run tests with the specified paramteres.

File

modules/acquia_contenthub_s3/tests/src/Kernel/S3FileOriginLocatorTest.php, line 207

Class

S3FileOriginLocatorTest
Tests the S3FileOriginLocator.

Namespace

Drupal\Tests\acquia_contenthub_s3\Kernel

Code

protected function initFileFixture(string $bucket, string $root_folder) : FileInterface {

  // Initialize test case.
  $file = $this
    ->createFileEntity('test.png', 's3');
  $origin = '96c3cc3f-17cf-48f3-8354-33a71300c676';
  $this->s3FileMap
    ->record($file
    ->uuid(), $bucket, $root_folder, $origin);
  return $file;
}