public function testExecuteWithIndexerNotWorking() { $ids = [1, 2, 3]; $this->indexerMock->expects($this->once())->method('isWorking')->will($this->returnValue(false)); $this->prepareIndexer(); $rowMock = $this->getMock('Magento\\Catalog\\Model\\Indexer\\Category\\Product\\Action\\Rows', ['execute'], [], '', false); $rowMock->expects($this->once())->method('execute')->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('catalog_category_product')->will($this->returnSelf()); $this->indexerMock->expects($this->once())->method('isWorking')->will($this->returnValue(false)); $rowMock = $this->getMock('Magento\\Catalog\\Model\\Indexer\\Category\\Product\\Action\\Rows', array('execute'), array(), '', false); $rowMock->expects($this->once())->method('execute')->with($ids, false)->will($this->returnSelf()); $this->rowsMock->expects($this->once())->method('create')->will($this->returnValue($rowMock)); $this->model->execute($ids); }