Skip to content

Commit

Permalink
MAGETWO-51545: [GitHub] [Dev Experience] Incorrect address TotalQty i…
Browse files Browse the repository at this point in the history
…n Totals Collector #3853

added value resetting
fixed unit test
  • Loading branch information
Serhiy Shkolyarenko committed Jun 9, 2016
1 parent b833016 commit e2e874d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function collect(
$baseVirtualAmount = $virtualAmount = 0;

$address = $shippingAssignment->getShipping()->getAddress();
$address->setTotalQty(0);
/**
* Process address items
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function testCollect($price, $originalPrice, $itemHasParent, $expectedPri
/** @var \Magento\Quote\Model\Quote\Address|\PHPUnit_Framework_MockObject_MockObject $address */
$address = $this->getMock(
'Magento\Quote\Model\Quote\Address',
[],
['setTotalQty', 'getTotalQty', 'removeItem', 'getQuote'],
[],
'',
false
Expand Down Expand Up @@ -133,6 +133,8 @@ public function testCollect($price, $originalPrice, $itemHasParent, $expectedPri

$shipping = $this->getMock('\Magento\Quote\Api\Data\ShippingInterface');
$shipping->expects($this->exactly(2))->method('getAddress')->willReturn($address);
$address->expects($this->at(0))->method('setTotalQty')->with(0);
$address->expects($this->any())->method('getTotalQty')->willReturn(0);
$shippingAssignmentMock = $this->getMock('\Magento\Quote\Api\Data\ShippingAssignmentInterface');
$shippingAssignmentMock->expects($this->exactly(2))->method('getShipping')->willReturn($shipping);
$shippingAssignmentMock->expects($this->once())->method('getItems')->willReturn([$quoteItem]);
Expand Down

0 comments on commit e2e874d

Please sign in to comment.