public function testExecuteWithIndexerNotWorking() { $ids = [1, 2, 3]; $this->indexerMock->expects($this->once())->method('isInvalid')->will($this->returnValue(false)); $this->indexerMock->expects($this->once())->method('isWorking')->will($this->returnValue(false)); $this->prepareIndexer(); $rowMock = $this->getMock('Magento\\Catalog\\Model\\Indexer\\Category\\Flat\\Action\\Rows', ['reindex'], [], '', false); $rowMock->expects($this->once())->method('reindex')->with($ids, false)->will($this->returnSelf()); $this->rowsMock->expects($this->once())->method('create')->will($this->returnValue($rowMock)); $this->model->execute($ids); }
public function testExecuteWithIndexerNotWorking() { $ids = array(1, 2, 3); $this->indexerMock->expects($this->once())->method('load')->with(\Magento\Catalog\Model\Indexer\Category\Flat\State::INDEXER_ID)->will($this->returnSelf()); $this->indexerMock->expects($this->once())->method('isInvalid')->will($this->returnValue(false)); $this->indexerMock->expects($this->once())->method('isWorking')->will($this->returnValue(false)); $rowMock = $this->getMock('Magento\\Catalog\\Model\\Indexer\\Category\\Flat\\Action\\Rows', array('reindex'), array(), '', false); $rowMock->expects($this->once())->method('reindex')->with($ids, false)->will($this->returnSelf()); $this->rowsMock->expects($this->once())->method('create')->will($this->returnValue($rowMock)); $this->model->execute($ids); }
/** * {@inheritdoc} */ public function execute($ids) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'execute'); if (!$pluginInfo) { return parent::execute($ids); } else { return $this->___callPlugins('execute', func_get_args(), $pluginInfo); } }