Exemplo n.º 1
0
 public function testExecuteFull()
 {
     /** @var \Magento\Catalog\Model\Indexer\Category\Product\Action\Full $productIndexerFlatFull */
     $productIndexerFlatFull = $this->getMock(\Magento\Catalog\Model\Indexer\Category\Product\Action\Full::class, [], [], '', false);
     $this->fullMock->expects($this->once())->method('create')->willReturn($productIndexerFlatFull);
     $productIndexerFlatFull->expects($this->once())->method('execute');
     $this->cacheContextMock->expects($this->once())->method('registerTags')->with([\Magento\Catalog\Model\Category::CACHE_TAG]);
     $this->model->executeFull();
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function executeRow($id)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'executeRow');
     if (!$pluginInfo) {
         return parent::executeRow($id);
     } else {
         return $this->___callPlugins('executeRow', func_get_args(), $pluginInfo);
     }
 }
Exemplo n.º 5
0
 /**
  * @param \Magento\Catalog\Model\Indexer\Category\Product\Action\FullFactory $fullActionFactory
  * @param Category\Action\RowsFactory $rowsActionFactory
  * @param \Magento\Framework\Indexer\IndexerRegistry $indexerRegistry
  */
 public function __construct(\Magento\Catalog\Model\Indexer\Category\Product\Action\FullFactory $fullActionFactory, Category\Action\RowsFactory $rowsActionFactory, \Magento\Framework\Indexer\IndexerRegistry $indexerRegistry)
 {
     parent::__construct($fullActionFactory, $rowsActionFactory, $indexerRegistry);
 }
Exemplo n.º 6
0
 /**
  * @param \Magento\Catalog\Model\Indexer\Category\Product\Action\FullFactory $fullActionFactory
  * @param Category\Action\RowsFactory $rowsActionFactory
  * @param \Magento\Indexer\Model\IndexerInterface $indexer
  */
 public function __construct(\Magento\Catalog\Model\Indexer\Category\Product\Action\FullFactory $fullActionFactory, Category\Action\RowsFactory $rowsActionFactory, \Magento\Indexer\Model\IndexerInterface $indexer)
 {
     parent::__construct($fullActionFactory, $rowsActionFactory, $indexer);
 }