You are here

protected function S3FileOriginLocatorTest::runTestWith in Acquia Content Hub 8.2

Run tests with the specified paramteres.

Parameters

string $origin_bucket: The publisher's bucket name.

string $origin_root_folder: The publisher's root_folder name.

bool $with_image_style: Whether to include image style path alteration.

Throws

\Exception

2 calls to S3FileOriginLocatorTest::runTestWith()
S3FileOriginLocatorTest::testGetS3FileSourcePublisherHasNoRoot in modules/acquia_contenthub_s3/tests/src/Kernel/S3FileOriginLocatorTest.php
@covers ::getS3FileSource @dataProvider sourceDataProvider
S3FileOriginLocatorTest::testGetS3FileSourcePublisherHasRoot in modules/acquia_contenthub_s3/tests/src/Kernel/S3FileOriginLocatorTest.php
@covers ::getS3FileSource @dataProvider sourceDataProvider

File

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

Class

S3FileOriginLocatorTest
Tests the S3FileOriginLocator.

Namespace

Drupal\Tests\acquia_contenthub_s3\Kernel

Code

protected function runTestWith(string $origin_bucket, string $origin_root_folder, bool $with_image_style) : void {
  $file = $this
    ->initFileFixture($origin_bucket, $origin_root_folder);
  $uri = $file
    ->getFileUri();
  if ($with_image_style) {
    $image_style = $this
      ->createImageStyle();
    $uri = $image_style
      ->buildUri($file
      ->getFileUri());
  }
  $source = $this
    ->constructS3Locator()
    ->getS3FileSource($uri);
  $expected = [
    'bucket' => $origin_bucket,
    'root_folder' => $origin_root_folder,
  ];
  $this
    ->assertEqual($source, $expected);
}