Exemple #1
0
 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);
 }
Exemple #2
0
 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);
 }