You are here

public function AssetFileEntityHelperTest::testCreateNewFile in Media: Acquia DAM 8

Validates we can create a new file.

File

tests/src/Unit/AssetFileEntityHelperTest.php, line 73

Class

AssetFileEntityHelperTest
Tests to validate that our file entity helper works as expected.

Namespace

Drupal\Tests\media_acquiadam\Unit

Code

public function testCreateNewFile() {
  $asset = $this
    ->getAssetData();
  $this
    ->assertInstanceOf(FileInterface::class, $this->assetFileEntityHelper
    ->createNewFile($asset, 'private://assets/replaced'));
  $this
    ->assertFalse($this->assetFileEntityHelper
    ->createNewFile($asset, 'random://bad/folder'));
}