@@ -78,6 +78,7 @@ public function testCollect($price, $originalPrice, $itemHasParent, $expectedPri
78
78
$ this ->stockRegistry ->expects ($ this ->any ())->method ('getStockItem ' )->willReturn ($ this ->stockItemMock );
79
79
80
80
$ priceCurrency = $ this ->getMockBuilder ('Magento\Framework\Pricing\PriceCurrencyInterface ' )->getMock ();
81
+ $ convertedPrice = 1231313 ;
81
82
// @TODO this is a wrong test and it does not check methods. Any digital value will be correct
82
83
$ priceCurrency ->expects ($ this ->any ())->method ('convert ' )->willReturn (1231313 );
83
84
@@ -114,14 +115,16 @@ public function testCollect($price, $originalPrice, $itemHasParent, $expectedPri
114
115
$ product ->expects ($ this ->any ())->method ('isVisibleInCatalog ' )->will ($ this ->returnValue (true ));
115
116
116
117
$ quote ->expects ($ this ->any ())->method ('getStore ' )->will ($ this ->returnValue ($ store ));
117
- $ quoteItem ->setProduct ($ product )->setQuote ($ quote )-> setOriginalCustomPrice ( $ price ) ;
118
+ $ quoteItem ->setProduct ($ product )->setQuote ($ quote );
118
119
119
120
$ parentQuoteItem = false ;
120
121
if ($ itemHasParent ) {
121
122
$ parentQuoteItem = $ this ->getMock ('Magento\Quote\Model\Quote\Item ' , [], [], '' , false );
122
123
$ parentQuoteItem ->expects ($ this ->any ())->method ('getProduct ' )->will ($ this ->returnValue ($ product ));
123
124
}
124
125
$ quoteItem ->setParentItem ($ parentQuoteItem );
126
+ //This value will be overwritten
127
+ $ quoteItem ->setConvertedPrice (10 );
125
128
126
129
$ priceModel = $ this ->getMock ('\Magento\Catalog\Model\Product\Type\Price ' , [], [], '' , false );
127
130
$ priceModel ->expects ($ this ->any ())->method ('getChildFinalPrice ' )->willReturn ($ price );
@@ -149,6 +152,8 @@ public function testCollect($price, $originalPrice, $itemHasParent, $expectedPri
149
152
150
153
$ this ->assertEquals ($ expectedPrice , $ quoteItem ->getPrice ());
151
154
$ this ->assertEquals ($ expectedOriginalPrice , $ quoteItem ->getBaseOriginalPrice ());
155
+ $ this ->assertEquals ($ convertedPrice , $ quoteItem ->getCalculationPrice ());
156
+ $ this ->assertEquals ($ convertedPrice , $ quoteItem ->getConvertedPrice ());
152
157
}
153
158
154
159
public function testFetch ()
0 commit comments