You are here

public function MediaEntityHelperTest::testGetAsset in Media: Acquia DAM 8

Validates that we can get the asset.

File

tests/src/Unit/MediaEntityHelperTest.php, line 100

Class

MediaEntityHelperTest
Testing of the Media Entity helper class.

Namespace

Drupal\Tests\media_acquiadam\Unit

Code

public function testGetAsset() {
  $this
    ->assertInstanceOf(Asset::class, $this
    ->getNewMediaEntityHelper()
    ->getAsset());

  // Change our source field to simulate a missing asset.
  $media = $this
    ->getMockedMediaEntity($this
    ->getAssetData()->id, 'phpunit_test_fail');
  $this
    ->assertFalse($this
    ->getNewMediaEntityHelper($media)
    ->getAsset());
}