Example #1
0
 /**
  * @param boolean $shellHasErrors
  * @dataProvider processRequestDataProvider
  */
 public function testProcessRequest($shellHasErrors)
 {
     $shell = $this->getMock('Magento\\Indexer\\Model\\Shell', array(), array(), '', false);
     $shell->expects($this->once())->method('hasErrors')->will($this->returnValue($shellHasErrors));
     $shell->expects($this->once())->method('run');
     $this->shellFactoryMock->expects($this->any())->method('create')->will($this->returnValue($shell));
     $this->entryPoint->launch();
 }
Example #2
0
 /**
  * @param boolean $shellHasErrors
  * @dataProvider processRequestDataProvider
  */
 public function testProcessRequest($shellHasErrors)
 {
     $shell = $this->getMock('Magento\\Index\\Model\\Shell', array(), array(), '', false);
     $shell->expects($this->once())->method('hasErrors')->will($this->returnValue($shellHasErrors));
     $shell->expects($this->once())->method('run');
     if ($shellHasErrors) {
         $this->_responseMock->expects($this->once())->method('setCode')->with(-1);
     } else {
         $this->_responseMock->expects($this->once())->method('setCode')->with(0);
     }
     $this->_shellFactory->expects($this->any())->method('create')->will($this->returnValue($shell));
     $this->_entryPoint->launch();
 }
 public function testCatchException()
 {
     $bootstrap = $this->getMock('Magento\\Framework\\App\\Bootstrap', array(), array(), '', false);
     $this->assertFalse($this->_entryPoint->catchException($bootstrap, new \Exception()));
 }