36 $this->imageMock->expects($this->any())->method(
'getMediaEntryType')->willReturn(
'image');
41 $this->videoMock->expects($this->any())->method(
'getMediaEntryType')->willReturn(
'external-video');
43 $this->dataObjectMock = $this->createMock(\
Magento\Framework\DataObject::class);
48 $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
53 'mediaGalleryEntryConvertersCollection' => [$this->imageMock, $this->videoMock]
57 $result = $converterPool->getConverterByMediaType(
'image');
63 $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
68 'mediaGalleryEntryConvertersCollection' => [$this->imageMock, $this->videoMock]
72 $result = $converterPool->getConverterByMediaType(
'external-video');
78 $this->expectException(
'\InvalidArgumentException');
80 $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
85 'mediaGalleryEntryConvertersCollection' => [$this->dataObjectMock]
89 $converterPool->getConverterByMediaType(
'external-video');
94 $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
99 'mediaGalleryEntryConvertersCollection' => [$this->imageMock, $this->videoMock]
103 $this->expectException(\
Magento\Framework\
Exception\LocalizedException::class);
105 $converterPool->getConverterByMediaType(
'something_wrong');
testGetConverterByMediaTypeImage()
testGetConverterByMediaTypeVideo()
testGetConverterByMediaTypeImageException()