18 private $swatchHelper;
28 private $cacheInvalidate;
32 $this->typeList = $this->createMock(\
Magento\Framework\
App\Cache\TypeListInterface::class);
33 $this->swatchHelper = $this->createMock(\
Magento\Swatches\Helper\Data::class);
36 $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
38 \
Magento\Swatches\Plugin\Catalog\CacheInvalidate::class,
40 'typeList' => $this->typeList,
41 'swatchHelper' => $this->swatchHelper
48 $this->swatchHelper->expects($this->atLeastOnce())->method(
'isSwatchAttribute')->with($this->attribute)
50 $this->typeList->expects($this->at(0))->method(
'invalidate')->with(
'block_html');
51 $this->typeList->expects($this->at(1))->method(
'invalidate')->with(
'collections');
52 $this->assertSame($this->attribute, $this->cacheInvalidate->afterSave($this->attribute, $this->attribute));
57 $this->swatchHelper->expects($this->atLeastOnce())->method(
'isSwatchAttribute')->with($this->attribute)
59 $this->typeList->expects($this->never())->method(
'invalidate');
60 $this->assertSame($this->attribute, $this->cacheInvalidate->afterSave($this->attribute, $this->attribute));