11 use Magento\Setup\Fixtures\ImagesGenerator\ImagesGeneratorFactory;
20 private $swatchesGeneratorMock;
25 private $imagePathFixture = [
26 'option_1' =>
'/<-o->',
34 $swatchHelperMock = $this->getMockBuilder(Media::class)
35 ->disableOriginalConstructor()
39 ->expects($this->any())
40 ->method(
'moveImageFromTmp')
41 ->willReturnOnConsecutiveCalls(...array_values($this->imagePathFixture));
44 $imageGeneratorMock = $this->getMockBuilder(ImagesGenerator::class)
45 ->disableOriginalConstructor()
49 ->expects($this->any())
53 $imageGeneratorFactoryMock = $this->getMockBuilder(ImagesGeneratorFactory::class)
54 ->disableOriginalConstructor()
55 ->setMethods([
'create'])
58 $imageGeneratorFactoryMock
59 ->expects($this->once())
61 ->willReturn($imageGeneratorMock);
65 $imageGeneratorFactoryMock
72 $attributeColorType[
'swatchvisual'][
'value'] = array_reduce(
81 $attributeColorType[
'optionvisual'][
'value'] = array_reduce(
90 $attributeImageType = $attributeColorType;
91 $attributeImageType[
'swatchvisual'][
'value'] = array_map(
93 return ltrim(
$item,
'/');
95 $this->imagePathFixture
100 $this->swatchesGeneratorMock->generateSwatchData(3,
'test',
'color')
105 $this->swatchesGeneratorMock->generateSwatchData(3,
'test',
'image')
const SWATCH_INPUT_TYPE_VISUAL