/** * @param string $oldValue * @param string $value * @dataProvider dataProviderProcessValueOff */ public function testProcessValueOff($oldValue, $value) { $this->configMock->expects($this->once())->method('getValue')->with(null, 'default')->will($this->returnValue($oldValue)); $this->model->setValue($value); $this->indexerStateMock->expects($this->never())->method('loadByIndexer'); $this->indexerStateMock->expects($this->never())->method('setStatus'); $this->indexerStateMock->expects($this->never())->method('save'); $indexerMock = $this->getMockForAbstractClass('Magento\\Framework\\Indexer\\IndexerInterface', [], '', false, false, true, ['setScheduled', '__wakeup']); $indexerMock->expects($this->once())->method('setScheduled')->with(false); $this->indexerProcessorMock->expects($this->once())->method('getIndexer')->will($this->returnValue($indexerMock)); $this->model->processValue(); }
/** * @param string $oldValue * @param string $value * @dataProvider dataProviderProcessValueOff */ public function testProcessValueOff($oldValue, $value) { $this->configMock->expects($this->once())->method('getValue')->with(null, 'default')->will($this->returnValue($oldValue)); $this->model->setValue($value); $this->indexerStateMock->expects($this->never())->method('loadByIndexer'); $this->indexerStateMock->expects($this->never())->method('setStatus'); $this->indexerStateMock->expects($this->never())->method('save'); $this->indexerRegistry->expects($this->once())->method('get')->with('catalog_category_flat')->willReturn($this->flatIndexer); $this->flatIndexer->expects($this->once())->method('setScheduled')->with(false); $this->model->processValue(); }