You are here

public function AcquiadamKernelTestBase::getAssetFileEntity in Media: Acquia DAM 8

Get asset file entity from Media entity.

Parameters

\Drupal\media\MediaInterface $media: The media entity to get the file from.

Return value

mixed The referenced file entity.

2 calls to AcquiadamKernelTestBase::getAssetFileEntity()
AcquiadamMediaTest::testAssetFileIsCorrect in tests/src/Kernel/AcquiadamMediaTest.php
Tests if updating multiple revisionable entities.
AcquiadamMediaTest::testNewVersionUpdate in tests/src/Kernel/AcquiadamMediaTest.php
Tests updating media entity when new version is available.

File

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

Class

AcquiadamKernelTestBase
Base class for Acquia DAM kernel tests.

Namespace

Drupal\Tests\media_acquiadam\Kernel

Code

public function getAssetFileEntity(MediaInterface $media) {
  return current($media
    ->get('field_acquiadam_asset_file')
    ->referencedEntities());
}