/** * @param $productScheduled * @param $expectedProductReindexCall * * @dataProvider reindexFlatDisabledTestDataProvider */ public function testReindexFlatDisabled($productScheduled, $expectedProductReindexCall) { $affectedProductIds = ["1", "2"]; $this->category->setAffectedProductIds($affectedProductIds); $pathIds = ['path/1/2', 'path/2/3']; $this->category->setData('path_ids', $pathIds); $this->category->setId('123'); $this->flatState->expects($this->any())->method('isFlatEnabled')->will($this->returnValue(false)); $this->productIndexer->expects($this->exactly(1))->method('isScheduled')->will($this->returnValue($productScheduled)); $this->productIndexer->expects($this->exactly($expectedProductReindexCall))->method('reindexList')->with($pathIds); $this->indexerRegistry->expects($this->at(0))->method('get')->with(Indexer\Category\Product::INDEXER_ID)->will($this->returnValue($this->productIndexer)); $this->category->reindex(); }
/** * {@inheritdoc} */ public function reindex() { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'reindex'); if (!$pluginInfo) { return parent::reindex(); } else { return $this->___callPlugins('reindex', func_get_args(), $pluginInfo); } }