Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 3
0
 public function testExecuteFull()
 {
     /** @var \Magento\Catalog\Model\Indexer\Category\Flat\Action\Full $categoryIndexerFlatFull */
     $categoryIndexerFlatFull = $this->getMock(\Magento\Catalog\Model\Indexer\Category\Flat\Action\Full::class, [], [], '', false);
     $this->fullMock->expects($this->once())->method('create')->willReturn($categoryIndexerFlatFull);
     $categoryIndexerFlatFull->expects($this->once())->method('reindexAll');
     $this->cacheContextMock->expects($this->once())->method('registerTags')->with([\Magento\Catalog\Model\Category::CACHE_TAG]);
     $this->model->executeFull();
 }
Exemplo n.º 4
0
 /**
  * {@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);
     }
 }