getFormats() public method

public getFormats ( $id, $fileName, $storageOptions, $version, $subVersion, $mimeType )
Example #1
0
 public function testGetFormatsNotSupportedMimeType()
 {
     $mediaRepository = $this->prophesize('Sulu\\Bundle\\MediaBundle\\Entity\\MediaRepository');
     $originalStorage = $this->prophesize('Sulu\\Bundle\\MediaBundle\\Media\\Storage\\StorageInterface');
     $formatCache = $this->prophesize('Sulu\\Bundle\\MediaBundle\\Media\\FormatCache\\FormatCacheInterface');
     $converter = $this->prophesize('Sulu\\Bundle\\MediaBundle\\Media\\ImageConverter\\ImageConverterInterface');
     $videoThumbnailService = $this->prophesize('Sulu\\Bundle\\MediaBundle\\Media\\Video\\VideoThumbnailServiceInterface');
     $ghostScriptPath = '';
     $saveImage = true;
     $previewMimeTypes = ['gif'];
     $responseHeaders = [];
     $formats = ['640x480' => ['name' => '640x480', 'commands' => [['action' => 'resize', 'parameters' => ['x' => 640, 'y' => 480]]], 'options' => ['jpeg_quality' => 70, 'png_compression_level' => 6]]];
     $formatCache->getMediaUrl(1, 'dummy.mp3', ['a' => 'b'], '640x480', 1)->should(new NoCallsPrediction());
     $formatManager = new FormatManager($mediaRepository->reveal(), $originalStorage->reveal(), $formatCache->reveal(), $converter->reveal(), $videoThumbnailService->reveal(), $ghostScriptPath, $saveImage, $previewMimeTypes, $responseHeaders, $formats);
     $result = $formatManager->getFormats(1, 'dummy.mp3', ['a' => 'b'], 1, 'mp3');
     $this->assertEquals([], $result);
 }