public function testReindexRowForce() { $id = 1; $this->_stateMock->expects($this->once())->method('isFlatEnabled')->willReturn(true); $indexerMock = $this->getMockBuilder('Magento\\Indexer\\Model\\Indexer')->disableOriginalConstructor()->getMock(); $this->indexerRegistryMock->expects($this->any())->method('get')->with(Processor::INDEXER_ID)->willReturn($indexerMock); $indexerMock->expects($this->any())->method('isScheduled')->willReturn(true); $indexerMock->expects($this->any())->method('reindexList')->with($id)->willReturnSelf(); $this->_model->reindexRow($id, true); }
/** * Init indexing process after product save * * @return void */ public function reindex() { if ($this->_catalogProduct->isDataForProductCategoryIndexerWasChanged($this) || $this->isDeleted()) { $productCategoryIndexer = $this->indexerRegistry->get(Indexer\Product\Category::INDEXER_ID); if (!$productCategoryIndexer->isScheduled()) { $productCategoryIndexer->reindexRow($this->getId()); } } $this->_productFlatIndexerProcessor->reindexRow($this->getEntityId()); }
/** * Init indexing process after product save * * @return void */ public function reindex() { $this->_productFlatIndexerProcessor->reindexRow($this->getEntityId()); if (!$this->getCategoryIndexer()->isScheduled()) { $this->getCategoryIndexer()->reindexRow($this->getId()); } }