예제 #1
0
 public function testCancel()
 {
     $this->orderItemFactoryMock->expects($this->once())->method('create')->willReturn($this->orderItemMock);
     $this->orderItemMock->expects($this->once())->method('load')->with(1)->willReturnSelf();
     $this->orderItemMock->expects($this->once())->method('getQtyInvoiced')->willReturn(1);
     $this->orderItemMock->expects($this->once())->method('getTaxInvoiced')->willReturn(1);
     $this->orderItemMock->expects($this->once())->method('getBaseTaxInvoiced')->willReturn(1);
     $this->orderItemMock->expects($this->once())->method('getDiscountTaxCompensationInvoiced')->willReturn(1);
     $this->orderItemMock->expects($this->once())->method('getBaseDiscountTaxCompensationInvoiced')->willReturn(1);
     $this->orderItemMock->expects($this->once())->method('getDiscountInvoiced')->willReturn(1);
     $this->orderItemMock->expects($this->once())->method('getBaseDiscountInvoiced')->willReturn(1);
     $this->orderItemMock->expects($this->once())->method('getRowInvoiced')->willReturn(1);
     $this->orderItemMock->expects($this->once())->method('getBaseRowInvoiced')->willReturn(1);
     $this->orderItemMock->expects($this->once())->method('setQtyInvoiced')->with(0)->willReturnSelf();
     $this->orderItemMock->expects($this->once())->method('setTaxInvoiced')->with(0)->willReturnSelf();
     $this->orderItemMock->expects($this->once())->method('setBaseTaxInvoiced')->with(0)->willReturnSelf();
     $this->orderItemMock->expects($this->once())->method('setDiscountTaxCompensationInvoiced')->with(0)->willReturnSelf();
     $this->orderItemMock->expects($this->once())->method('setBaseDiscountTaxCompensationInvoiced')->with(0)->willReturnSelf();
     $this->orderItemMock->expects($this->once())->method('setDiscountInvoiced')->with(0)->willReturnSelf();
     $this->orderItemMock->expects($this->once())->method('setBaseDiscountInvoiced')->with(0)->willReturnSelf();
     $this->orderItemMock->expects($this->once())->method('setRowInvoiced')->with(0)->willReturnSelf();
     $this->orderItemMock->expects($this->once())->method('setBaseRowInvoiced')->with(0)->willReturnSelf();
     $this->item->setData(['order_item_id' => 1, 'qty' => 1, 'tax_amount' => 1, 'base_tax_amount' => 1, 'discount_tax_compensation_amount' => 1, 'base_discount_tax_compensation_amount' => 1, 'discount_amount' => 1, 'base_discount_amount' => 1, 'row_total' => 1, 'base_row_total' => 1]);
     $this->assertEquals($this->item->cancel(), $this->item);
 }