47 $this->reinitableConfig = $this->getMockForAbstractClass(
53 $this->indexerRegistry = $this->createMock(\
Magento\Framework\Indexer\IndexerRegistry::class);
54 $this->designConfig = $this->getMockForAbstractClass(
60 $this->designExtension = $this->getMockForAbstractClass(
67 [
'getDesignConfigData']
69 $this->designConfigData = $this->getMockForAbstractClass(
75 $this->indexer = $this->getMockForAbstractClass(
76 \
Magento\Framework\Indexer\IndexerInterface::class,
84 $this->repository = $objectManagerHelper->getObject(
85 DesignConfigRepository::class,
87 'configStorage' => $this->configStorage,
88 'reinitableConfig' => $this->reinitableConfig,
89 'indexerRegistry' => $this->indexerRegistry,
90 'validator' => $this->validator
97 $this->designConfig->expects($this->exactly(2))
98 ->method(
'getExtensionAttributes')
99 ->willReturn($this->designExtension);
100 $this->designExtension->expects($this->once())
101 ->method(
'getDesignConfigData')
102 ->willReturn([$this->designConfigData]);
103 $this->configStorage->expects($this->once())
105 ->willReturn($this->designConfig);
106 $this->reinitableConfig->expects($this->once())
108 $this->indexerRegistry->expects($this->once())
111 ->willReturn($this->indexer);
112 $this->indexer->expects($this->once())
113 ->method(
'reindexAll');
114 $this->validator->expects($this->once())->method(
'validate')->with($this->designConfig);
115 $this->assertSame($this->designConfig, $this->repository->save($this->designConfig));
124 $this->designConfig->expects($this->exactly(2))
125 ->method(
'getExtensionAttributes')
126 ->willReturn($this->designExtension);
127 $this->designExtension->expects($this->once())
128 ->method(
'getDesignConfigData')
130 $this->repository->save($this->designConfig);
135 $this->designConfig->expects($this->exactly(2))
136 ->method(
'getExtensionAttributes')
137 ->willReturn($this->designExtension);
138 $this->designExtension->expects($this->once())
139 ->method(
'getDesignConfigData')
140 ->willReturn([$this->designConfigData]);
141 $this->configStorage->expects($this->once())
143 ->with($this->designConfig);
144 $this->reinitableConfig->expects($this->once())
146 $this->indexerRegistry->expects($this->once())
149 ->willReturn($this->indexer);
150 $this->indexer->expects($this->once())
151 ->method(
'reindexAll');
152 $this->assertSame($this->designConfig, $this->repository->delete($this->designConfig));
const DESIGN_CONFIG_GRID_INDEXER_ID