public function testExecute() { $dir = $this->getMock('Magento\\Framework\\Filesystem\\Directory\\Write', [], [], '', false); $dir->expects($this->any())->method('getRelativePath')->will($this->returnArgument(0)); $this->filesystem->expects($this->once())->method('getDirectoryWrite')->will($this->returnValue($dir)); $this->processor->expects($this->once())->method('reindexAll'); $this->assertEquals('0', $this->entryPoint->launch()); }
public function testReindexAll() { $indexerMock = $this->getMock('Magento\\Indexer\\Model\\Indexer', [], [], '', false); $indexerMock->expects($this->exactly(2))->method('reindexAll'); $indexers = [$indexerMock, $indexerMock]; $indexersMock = $this->getMock('Magento\\Indexer\\Model\\Indexer\\Collection', [], [], '', false); $this->indexersFactoryMock->expects($this->once())->method('create')->will($this->returnValue($indexersMock)); $indexersMock->expects($this->once())->method('getItems')->will($this->returnValue($indexers)); $this->model->reindexAll(); }
/** * @param bool $isExist * @param array $callCount * @dataProvider executeProvider */ public function testExecute($isExist, $callCount) { $this->_response->expects($this->once())->method('setCode')->with(0); $this->_response->expects($this->once())->method('getCode')->will($this->returnValue(0)); $dir = $this->getMock('Magento\\Framework\\Filesystem\\Directory\\Write', [], [], '', false); $dir->expects($this->any())->method('getRelativePath')->will($this->returnArgument(0)); $dir->expects($this->once())->method('isExist')->will($this->returnValue($isExist)); $dir->expects($this->exactly($callCount))->method('delete')->will($this->returnValue(true)); $this->filesystem->expects($this->once())->method('getDirectoryWrite')->will($this->returnValue($dir)); $this->processor->expects($this->once())->method('reindexAll'); $this->assertEquals(0, $this->entryPoint->launch()->getCode()); }
/** * {@inheritdoc} */ public function updateMview() { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'updateMview'); if (!$pluginInfo) { return parent::updateMview(); } else { return $this->___callPlugins('updateMview', func_get_args(), $pluginInfo); } }
/** * Clean indexer view changelogs * * @return void */ public function execute() { $this->processor->clearChangelog(); }
/** * Regenerate indexes for all invalid indexers * * @return void */ public function execute() { $this->processor->reindexAllInvalid(); }
public function testClearChangelog() { $this->viewProcessorMock->expects($this->once())->method('clearChangelog')->with('indexer')->willReturnSelf(); $this->model->clearChangelog(); }
public function testExecute() { $this->processorMock->expects($this->once())->method('reindexAll'); $this->assertEquals('0', $this->entryPoint->launch()); }
/** * Regenerate indexes for all invalid indexers * * @return void */ public function execute() { $this->processor->updateMview(); }