public function AssetFileEntityHelperTest::testGetDestinationFromEntity in Media: Acquia DAM 8
Validates that the file destination builds correctly.
File
- tests/
src/ Unit/ AssetFileEntityHelperTest.php, line 58
Class
- AssetFileEntityHelperTest
- Tests to validate that our file entity helper works as expected.
Namespace
Drupal\Tests\media_acquiadam\UnitCode
public function testGetDestinationFromEntity() {
$media = $this
->getMockedMediaEntity($this
->getAssetData()->id);
$this
->assertEquals('private://assets/replaced', $this->assetFileEntityHelper
->getDestinationFromEntity($media, 'phpunit_file_field'));
$this
->assertEquals('public://acquiadam_assets', $this->assetFileEntityHelper
->getDestinationFromEntity($media, 'phpunit_test_fail'));
}