Exemple #1
0
 public function testRegister()
 {
     $orderItemMock = $this->getMockBuilder('Magento\\Sales\\Model\\Order\\Item')->disableOriginalConstructor()->getMock();
     $orderItemMock->expects($this->once())->method('getQtyRefunded')->willReturn(1);
     $orderItemMock->expects($this->once())->method('getTaxRefunded')->willReturn(1);
     $orderItemMock->expects($this->once())->method('getBaseTaxRefunded')->willReturn(1);
     $orderItemMock->expects($this->once())->method('getDiscountTaxCompensationRefunded')->willReturn(1);
     $orderItemMock->expects($this->once())->method('getBaseDiscountTaxCompensationRefunded')->willReturn(1);
     $orderItemMock->expects($this->once())->method('getAmountRefunded')->willReturn(1);
     $orderItemMock->expects($this->once())->method('getBaseAmountRefunded')->willReturn(1);
     $orderItemMock->expects($this->once())->method('getDiscountRefunded')->willReturn(1);
     $orderItemMock->expects($this->once())->method('getBaseDiscountRefunded')->willReturn(1);
     $orderItemMock->expects($this->once())->method('getQtyToRefund')->willReturn(1);
     $this->item->setQty(1);
     $this->item->setTaxAmount(1);
     $this->item->setBaseTaxAmount(1);
     $this->item->setDiscountTaxCompensationAmount(1);
     $this->item->setBaseDiscountTaxCompensationAmount(1);
     $this->item->setRowTotal(1);
     $this->item->setBaseRowTotal(1);
     $this->item->setDiscountAmount(1);
     $this->item->setBaseDiscountAmount(1);
     $this->item->setOrderItem($orderItemMock);
     $result = $this->item->register();
     $this->assertInstanceOf('Magento\\Sales\\Model\\Order\\Creditmemo\\Item', $result);
 }