示例#1
0
 /**
  * @expectedException \Exception
  * @expectedExceptionMessage An error has occurred during creating Creditmemo
  */
 public function testInvokeException()
 {
     $message = 'Can not save Creditmemo';
     $e = new \Exception($message);
     $creditmemoDataObjectMock = $this->getMockBuilder('Magento\\Sales\\Service\\V1\\Data\\Creditmemo')->disableOriginalConstructor()->setMethods([])->getMock();
     $this->loggerMock->expects($this->once())->method('logException')->with($e);
     $this->creditmemoConverterMock->expects($this->once())->method('getModel')->with($creditmemoDataObjectMock)->will($this->throwException($e));
     $this->creditmemoCreate->invoke($creditmemoDataObjectMock);
 }
示例#2
0
 /**
  * @param \Magento\Sales\Service\V1\Data\Creditmemo $creditmemoDataObject
  * @throws \Exception
  * @return bool
  */
 public function create(Creditmemo $creditmemoDataObject)
 {
     return $this->creditmemoCreate->invoke($creditmemoDataObject);
 }