AcquiadamAssetImageHelperTrait.php in Media: Acquia DAM 8
File
tests/src/Traits/AcquiadamAssetImageHelperTrait.php
View source
<?php
namespace Drupal\Tests\media_acquiadam\Traits;
use Drupal\media_acquiadam\Service\AssetImageHelper;
trait AcquiadamAssetImageHelperTrait {
public function getAssetImageHelperStub() {
$asset_image_helper = $this
->getMockBuilder(AssetImageHelper::class)
->disableOriginalConstructor()
->getMock();
$asset_image_helper
->method('getMimeTypeFromFileType')
->willReturnMap([
[
'jpg',
[
'discrete' => 'image',
'sub' => 'jpg',
],
],
[
'mov',
[
'discrete' => 'quicktime',
'sub' => 'mov',
],
],
[
'pdf',
[
'discrete' => 'application',
'sub' => 'pdf',
],
],
]);
$asset_image_helper
->method('getThumbnailUrlBySize')
->willReturn('http://subdomain.webdamdb.com/s/310th_sm_0UerYozlI3.jpg');
return $asset_image_helper;
}
}