/** * @param bool $value * @dataProvider executeDataProvider */ public function testLaunch($value) { $process = $this->getMock('Magento\\Index\\Model\\Process', array('getIndexer', 'reindexEverything', '__wakeup'), array(), '', false); $indexer = $this->getMock('Magento\\Index\\Model\\Indexer', array('getProcessesCollection'), array(), '', false); $indexerInterface = $this->getMock('Magento\\Index\\Model\\IndexerInterface'); $this->_indexFactoryMock->expects($this->once())->method('create')->will($this->returnValue($indexer)); $indexer->expects($this->once())->method('getProcessesCollection')->will($this->returnValue(array($process))); $process->expects($this->any())->method('getIndexer')->will($this->returnValue($indexerInterface)); if ($value) { $indexerInterface->expects($this->once())->method('isVisible')->will($this->returnValue(true)); $process->expects($this->once())->method('reindexEverything'); } else { $indexerInterface->expects($this->once())->method('isVisible')->will($this->returnValue(false)); $process->expects($this->never())->method('reindexEverything'); } $this->assertEquals($this->_responseMock, $this->_entryPoint->launch()); }
public function testCatchException() { $bootstrap = $this->getMock('Magento\\Framework\\App\\Bootstrap', [], [], '', false); $this->assertFalse($this->_entryPoint->catchException($bootstrap, new \Exception())); }