Example #1
0
 /**
  * @expectedException \Exception
  * @expectedExceptionMessage Integration with ID '1' doesn't exist.
  */
 public function testDeleteActionForServiceGenericException()
 {
     $intData = $this->_getSampleIntegrationData();
     $this->_integrationSvcMock->expects($this->any())->method('get')->with($this->anything())->willReturn($intData);
     $this->_requestMock->expects($this->once())->method('getParam')->willReturn(self::INTEGRATION_ID);
     // Use real translate model
     $this->_translateModelMock = null;
     $exceptionMessage = __("Integration with ID '%1' doesn't exist.", $intData[Info::DATA_ID]);
     $invalidIdException = new \Exception($exceptionMessage);
     $this->_integrationSvcMock->expects($this->once())->method('delete')->willThrowException($invalidIdException);
     $this->_messageManager->expects($this->never())->method('addError');
     $this->integrationController->execute();
 }