Example #1
0
 /**
  * @magentoDataFixture Magento/Bundle/_files/product.php
  * @covers \Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Full::reindexAll
  * @covers \Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Full::prepareProductIndex
  * @covers \Magento\Bundle\Model\Product\Type::getSearchableData
  */
 public function testPrepareProductIndexForBundlePeoduct()
 {
     $this->indexer->reindexAll();
     $select = $this->adapter->select()->from($this->resource->getTableName('catalogsearch_fulltext'))->where('`data_index` LIKE ?', '%' . 'Bundle Product Items' . '%');
     $result = $this->adapter->fetchAll($select);
     $this->assertCount(1, $result);
 }
 public function testExecuteRow()
 {
     $id = 1;
     $stores = [0 => 'Store 1', 1 => 'Store 2'];
     $indexData = new \ArrayObject([]);
     $this->storeManager->expects($this->once())->method('getStores')->willReturn($stores);
     $this->saveHandler->expects($this->exactly(count($stores)))->method('deleteIndex');
     $this->saveHandler->expects($this->exactly(count($stores)))->method('saveIndex');
     $this->fullAction->expects($this->exactly(count($stores)))->method('rebuildStoreIndex')->willReturn($indexData);
     $this->model->executeRow($id);
 }
Example #3
0
 public function testReindexAll()
 {
     $this->storeManager->expects($this->once())->method('getStores')->willReturn([]);
     $this->searchRequestConfig->expects($this->once())->method('reset');
     $this->object->reindexAll();
 }