public function testGenerateSwatchVariations() { $this->mediaDirectoryMock->expects($this->atLeastOnce())->method('getAbsolutePath')->willReturn('attribute/swatch/e/a/earth.png'); $image = $this->getMock('\\Magento\\Framework\\Image', ['resize', 'save', 'keepTransparency', 'constrainOnly', 'keepFrame', 'keepAspectRatio', 'backgroundColor', 'quality'], [], '', false); $this->imageFactoryMock->expects($this->any())->method('create')->willReturn($image); $this->generateImageConfig(); $image->expects($this->any())->method('resize')->will($this->returnSelf()); $this->mediaHelperObject->generateSwatchVariations('/e/a/earth.png'); }
public function testGetImageProcessor() { $imageProcessor = $this->getMockBuilder('\\Magento\\Framework\\Image')->disableOriginalConstructor()->getMock(); $this->factory->expects($this->once())->method('create')->will($this->returnValue($imageProcessor)); $this->assertSame($imageProcessor, $this->image->getImageProcessor()); }