35 $this->_eventManagerMock = $this->createMock(\
Magento\Framework\Event\ManagerInterface::class);
36 $this->indexBuilder = $this->createMock(\
Magento\CatalogRule\Model\Indexer\IndexBuilder::class);
38 $this->indexer = $this->getMockForAbstractClass(
39 AbstractIndexer::class,
42 $this->_eventManagerMock
45 $cacheMock = $this->createMock(\
Magento\Framework\
App\CacheInterface::class);
46 $reflection = new \ReflectionClass(AbstractIndexer::class);
47 $reflectionProperty = $reflection->getProperty(
'cacheManager');
48 $reflectionProperty->setAccessible(
true);
49 $reflectionProperty->setValue($this->indexer, $cacheMock);
60 $this->indexer->expects($this->once())->method(
'doExecuteList')->with($ids);
62 $this->indexer->execute($ids);
72 $this->indexBuilder->expects($this->once())->method(
'reindexFull');
73 $this->_eventManagerMock->expects($this->once())
76 'clean_cache_by_tags',
77 [
'object' => $this->indexer]
80 $this->indexer->executeFull();
91 $this->indexer->executeList([]);
102 $this->indexer->expects($this->once())->method(
'doExecuteList')->with($ids);
104 $this->indexer->executeList($ids);
115 $this->indexer->executeRow(
null);
126 $this->indexer->expects($this->once())->method(
'doExecuteRow')->with(
$id);
128 $this->indexer->executeRow(
$id);
testExecuteRowWithEmptyId()
testExecuteListWithEmptyIds()