You are here

protected function AcquiadamKernelTestBase::getAssetUri in Media: Acquia DAM 8

Get the URI from a given asset.

Parameters

\cweagans\webdam\Entity\Asset $asset: The asset to generate the URI.

\Drupal\media\MediaInterface $media: The media entity for this asset.

Return value

string The expected URI for the asset.

Throws

\Exception

3 calls to AcquiadamKernelTestBase::getAssetUri()
AcquiadamMediaTest::testAssetFileIsCorrect in tests/src/Kernel/AcquiadamMediaTest.php
Tests if updating multiple revisionable entities.
AcquiadamMediaTest::testFieldMappings in tests/src/Kernel/AcquiadamMediaTest.php
Tests if field mappings work as expected.
AcquiadamMediaTest::testNewVersionUpdate in tests/src/Kernel/AcquiadamMediaTest.php
Tests updating media entity when new version is available.

File

tests/src/Kernel/AcquiadamKernelTestBase.php, line 130

Class

AcquiadamKernelTestBase
Base class for Acquia DAM kernel tests.

Namespace

Drupal\Tests\media_acquiadam\Kernel

Code

protected function getAssetUri(Asset $asset, MediaInterface $media) {
  $destination_folder = $this->container
    ->get('media_acquiadam.asset_file.helper')
    ->getDestinationFromEntity($media, 'field_acquiadam_asset_file');
  return sprintf('%s/%s', $destination_folder, $asset->filename);
}